-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Theme: lower the contrast topup value #73155
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
Conversation
|
Size Change: +11 B (0%) Total Size: 2.42 MB
ℹ️ View Unchanged
|
aduth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
2d93a63 to
dffcda2
Compare
That's a great observation, the 1.02 target contrast is indeed too low, the surface colors are too close to each other. I increased it to 1.06 and now the |
|
Flaky tests detected in dffcda2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19292856579
|


When we're searching for a color that has a contrast 1.07 (for example) against the seed, we add a "topup" constant before the search, so that after all rounding and approximations the contrast is strictly higher than 1.07. Otherwise the result contrast could be quite lower:
CONTRAST_EPSILON), so the found color could well have contrast just 1.066.#4a4a4a. So, when the color is rounded down, the real contrast can be as low as 1.058, a 0.012 difference.The topup constant is here to prevent this, but until now it's been way too high. This PR changes the 0.05 value to the theoretically best 0.012 value.
This changes the default ramps quite visibly. For example, the
surface3background color, used for thesurface-neutral-strongtoken, has changed from#fff(pure white) to#fcfcfc. That's because it's supposed to have contrast 1.02 against the seed color#f8f8f8. But after the 0.05 topup, we were aiming for 1.07, a much lighter color. Now we aim for just 1.032, which is satisfied by#fcfcfcand we don't need to go all the way to pure white.@jameskoster @poligilad How does this affect your recent efforts to adjust the seed color from
#f8f8f8to#fcfcfc? This PR shows that: