-
-
Notifications
You must be signed in to change notification settings - Fork 835
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: contrast util with yiq calculator #3652
Conversation
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.
Ooh, you moved this here! Makes sense.
I left a comment about exporting an isDark
util so we don't need to compare against 128 in our code in your draft PR. Could we do that here?
You're right! I'll do it asap :) |
@davwheat It seems a lot better, thanks for your advice! |
:) |
@Ornanovitch, @imorland, @davwheat |
please open a bug report with specifics. |
Needed for #3653
Changes proposed in this pull request:
isDark
utility converts a hex color to rgb, and then calcul a YIQ value in order to get the appropriate contrast value (is it dark or is it light?)@text-on-light
and@text-on-dark
See #3653 for example
See https://www.w3.org/TR/AERT/#color-contrast for references
Reviewers should focus on:
I don't know... Is the name getContrast ok regarding your naming conventions?
Screenshot
see #3653
Necessity
Confirmed
composer test
).