[csswg-drafts] [css-color] limited use of contrast adjuster

xi has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color] limited use of contrast adjuster ==
https://drafts.csswg.org/css-color-4/#contrast-adjuster

Usecase 1: *My website uses `background-color: #ddd` and `color: #333`. I want to add a button with a blue background and one of these colors for font. If none of these colors has enough contrast, it is ok to automatically pick a different one.* - currently it is not possible to pick colors from an existing color scheme.

Usecase 2: *I want to have a green button with blue font. The font color should be automatically adjusted to guarantee sufficient contrast.* - currently it is not possible to have a different hue than the base color.

Both these use cases could be catered for with an extension like this:

`contrast( <color1>?, <color2>?, <color3>?, …, <percentage>? )'`

- First the provided colors are checked. The first one that has sufficient contrast to the base color is picked. The percentage is ignored.
- If none of the provided colors have sufficient contrast, the one with the highest contrast is picked and adjusted as described in the current draft.
- If no color is provided, the method described in the current draft is used.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1627 using your GitHub account

Received on Thursday, 20 July 2017 11:03:20 UTC