-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: change breakpoint to switch black SVG img to white #1593
Conversation
c5b6b35
to
bf9b9d7
Compare
We're good ! |
I tried to be more accurate in the choice, so I scripted a map with (named) colors close to the threshold (in parentesis the weight computed by umap, which is just a sum of RGB values). Before this PR: With threshold = 150 With threshold = 140 With my human eyes, I feel like 140 is the best choice, but I'd like your review again on this @davidbgk @Aurelie-Jallut :) |
We need to check contrast on the green markers at the bottom but it's easier from a live version, let's do that together :) |
The number in brackets gives an indication of the weight of the color? I have the impression that there are colors above 140 that could accommodate a white picto like for example: Mediumpurple(159.33). |
bf9b9d7
to
a239633
Compare
👋 As Aurélie said the important thing is to have a 3:1 contrast ratio between icon and background. Usually green shades are kinda hard to match with white. Here is a totally overwhelming grid that checks contrast of a bunch of colors of the final screenshot (note I didn't check all of them, focused on the ones with white text). Don't worry you just have to look at the two first lines of the grid (or first two columns, as you wish). All the shown cells, which are the ones marked "DNP", do not have sufficient contrast with either black or white foreground. Few ideas to be sure to generate OK colors: |
I've decided for a basic home made util, because: - I'm not sure color is still maintained - colorjs.io sounds very cool and maintained, but is 105k - there is no custom bundle yet - it uses proper modules, but for just the contrast util we need to pull all the class logic, and it's a lot
I've been a report about changed pictograms, which pointed to this map:
I found that with those grey, the picto should have been white, so I had a look and increased a bit the threshold.
Before:
After: