Re: [csswg-drafts] [css-color-6] `contrast-color()` syntax proposal (#7954)

Some miscellaneous critique:

* The discussion during the last f2f concluded that it was almost certainly far too dangerous to allow an `auto` algorithm, except *maybe* if it was restricted to only giving black/white. When people use this function, they'll almost certainly rely on it to just do *something*, then visually check it, then build other colors around the result; if that result can change over time it can break a page (well, cause the colors to suddenly clash, or become insufficiently contrasted, etc). (Restricting an "auto" to just produce black/white is *probably* okay, since it's harder to clash or contrast badly if algos change in the future.) So, if we allow for an "auto" algo it should ignore the contrast level and only use "max".

* I like the use of "more" and "less" keywords to shorthand some common usages, tho they'll similarly need to be defined as using some *particular* contrast algo.

* I also like the default behavior of creating a result by maintaining the hue of the base color; that seems pretty reasonable, and seems to give good results in general.

* I think your grammar around target/algo isn't quite right. I think your intention is that you can give an algo, or a target, or both, and you only *need* both when specifying an explicit ratio, right? An algo by itself implies "auto" target; a target by itself implies "auto" algorithm?

* The use of `/` doesn't appear necessary here. It doesn't disambiguate anything, since colors, role, algo, and target are all distinct productions that can be told apart. The need for a separator was just to create a better visual distinction between the base color and the result colors. As it is, the algo/target look like they're associated with the first color in the result list, rather than being part of the overall function operation.

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


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

Received on Tuesday, 25 October 2022 21:59:37 UTC