-
Notifications
You must be signed in to change notification settings - Fork 268
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
Complement function? #12
Comments
Do you mean whether to use black or white text over a background color? Or are you thinking of something else? |
More like shades of gray, but black or white or a function that takes 3 colors, the background and two possible foreground colors (say #222 and #eee) and gives you the most appropriate of the two would also work. |
Seems like you could do something outside the library: function betterColor(bg, color1, color2) {
if (bg.contrast(color1) > bg.contrast(color2)) {
return color1;
}
return color2;
} |
Ah! Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ie. given a background color what's the appropriate foreground color and vise versa
The text was updated successfully, but these errors were encountered: