-
Notifications
You must be signed in to change notification settings - Fork 668
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
Define how accentcolor and currentcolor interact #10971
Comments
We're a bit constrained by the fact that a. If
Color accent_color =
GetAccentColorOrDefault(color_scheme, is_in_web_app_scope);
// This logic matches AccentColorText in Firefox. If the accent color to draw
// text on is dark, then use white. If it's light, then use dark.
return color_utils::GetRelativeLuminance4f(accent_color.toSkColor4f()) <= 128
? Color::kWhite
: Color::kBlack; For the four cases above, that would give us the following computed values, and I don't think there's any ambiguity about how to resolve further at used-value time: a. |
Not sure if quite what you're proposing, sorry if I'm just rephrasing. Something line with what we do for relative font units, would be to resolve "color: accentcolor/accentcolortext" and "accent-color: accentcolor/accentcolortext" relative to the inherited accent-color (and possibly color-scheme?), just like font-size: 2em resolves relative to the font of the parent. Given we definitely need that mechanism for accent-color: accentcolor, that might be simpler? |
I think that gives the same result at used-value time, but I don't know whether it would preserve the |
After #5900, we need to define what happens if you do stuff like
color: accentcolor; accent-color: currentColor;
and such.The text was updated successfully, but these errors were encountered: