Re: [csswg-drafts] [css-ui-4] choosing background colors for accent-color for contrast (#6159)

> I would be interested to know about these magic numbers

They're not magic. We have a "canonical" color scheme ([a few lines above](https://searchfox.org/mozilla-central/rev/acafeda74c3b263264ddb9fb21c45bb67d0de267/widget/nsNativeBasicTheme.cpp#123-134)), the one you get on Windows or with `widget.non-native-theme.use-theme-accent=false`.

Those numbers are just the luminance of the light / dark / darker colors in the canonical color scheme (25.04791, 9.33808, and 5.90106% respectively) divided by the luminance of the regular accent color (13.693%). So we scale the luminance of the accent color by similar amounts to achieve similar looks with different accent colors. We use a similar trick to auto-darken scrollbars too.

-- 
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6159#issuecomment-810701124 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 31 March 2021 02:04:59 UTC