Re: [csswg-drafts] [css-color-5] add target contrast ratio to color-contrast? (#4749)

I like the proposal here, where the ratio provides a minimum contrast – and selects the first passing value in the list. If none pass that ratio, I see several options:

1. Return the maximum contrasting color from the list, as though no ratio was given. This matches existing default behavior for the function, and leaves control with the author for better and worse.
2. Return the better contrast of `black` or `white`, as proposed above. This better matches the intent of ensuring an accessible ratio.

The idea of returning "closest ratio" is interesting. In some ways a nod to the idea that "contrast" is not always only about accessibility or text/background, but might be useful for other design goals – where you don't need to "pass" a particular value, but are more interested in creating a particular effect. Still, I think being able to order your preferences in a list, and select between min-or-max, would work pretty well to support those use-cases.

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

Received on Saturday, 22 February 2020 17:52:07 UTC