Re: [csswg-drafts] [css-color-6] `contrast-color()` MVP in Level 5 (#9166)

The CSS Working Group just discussed ``[css-color-6] `contrast-color()` MVP in Level 5``, and agreed to the following:

* `RESOLVED: function returns dark/light by default and the 'max' keyword for black/white`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> lea: Last week we decided we do want to add to spec contract-color for most common use cae. Getting a suitable text color for arbitrary bg color. Question is should UA return only white/black and make their own algo. Or return color is up to UA and the UA returns something guar. to be readable<br>
&lt;florian> q+<br>
&lt;TabAtkins> i can represent Nicole/Chrome on this issue<br>
&lt;dael> lea: Argument from Nicole is that leaves more room to UAs for innovation. Sometimes max contrast is not as readable for everyone. Some people tend to prefer lower contrast<br>
&lt;dael> lea: Argument for black/white it's more predictable so authors can use more reliably. Also it guar. it's more likely to be readable. Also b/c it's either black or white authros can add shadow, etc. as an ingredient to do what they want<br>
&lt;dael> lea: More versatile, more predictable.<br>
&lt;TabAtkins> Q+<br>
&lt;TabAtkins> Yup I do<br>
&lt;dael> lea: We started expressing opinions last time but ran out of time. And TabAtkins requested an extra week to discuss in Google<br>
&lt;florian> q- later<br>
&lt;TabAtkins> *they<br>
&lt;dael> Rossen_: fantasai, anything you want to add?<br>
&lt;dael> fantasai: I'm pretty closely matched to lea<br>
&lt;Rossen_> ack TabAtkins<br>
&lt;dael> TabAtkins: We had a discussion. Me, Nicole, some of the canvas impl. New proposal which is essentially the preference from lea but with a bit of flexibility. You give an impot, get an output that's very light or very dark. Within some delta-e distance of white/black. Something that allows a little bit of play but still very close.<br>
&lt;dael> TabAtkins: Also with a keyword switch, prop 'max', that locks you into black or white so you can get predictable output<br>
&lt;dael> TabAtkins: I think this maintains the nice benefits of pure black/white but also allows some additional quality for browsers without distinct differences we were worried about<br>
&lt;dael> TabAtkins: I think this should still be okay. And can allow just black/white if impl want simple<br>
&lt;Rossen_> ack florian<br>
&lt;lea> q+ to say I like the new proposal, especially since authors can still get black/white with the max keyword<br>
&lt;dael> florian: I'm glad I let TabAtkins go first. Was in favor of just black/white. A little concerned if there's something smarter people will use it in interesting ways and someone will have to reverse engineer to match. But maybe if you limit the delta it won't happen too much<br>
&lt;lea> though it should be &lt;color><br>
&lt;lea> * though it should be &lt;color> || max? I think<br>
&lt;Rossen_> ack lea<br>
&lt;Zakim> lea, you wanted to say I like the new proposal, especially since authors can still get black/white with the max keyword<br>
&lt;dael> florian: Perhaps reverse risk where some browsers aren't smart and people don't think to engineer for the slightly different. Not entirely sure it's worth it, but you seem to think it would be<br>
&lt;TabAtkins> not too stressed on the ordering, i think our previous grammars did put the &lt;color> first to make things slightly more consistent/parseable<br>
&lt;TabAtkins> `&lt;color> &amp;&amp; max?`<br>
&lt;dael> lea: I like new proposal. authors can get balck/white with max keywork, but if they want something just looking nice they can get that. I think it should be possible to put values in either order.<br>
&lt;dael> Rossen_: [reads TabAtkins IRC]<br>
&lt;dael> Rossen_: Seems like new proposal from TabAtkins is winning solution here. Other opinions?<br>
&lt;lea> q?<br>
&lt;astearns> I am skeptical there are quality-of-implementation tweaks that will make this switch worth it (I expect you would need to know *what* the color will be used for to make effective tweaks). But I will not object.<br>
&lt;dael> TabAtkins: I propose lea and chris tell us the reasonable variation<br>
&lt;florian> s/people don't think to engineer for the slightly different/authors don't bother specifying max before applying effects, and then the browser(s) that were trying to be smart might need to revert to pure black and pure white, but then we're not worse off than where we started/<br>
&lt;lea> q+ one concern, from my designer days: It's much more common to want white text on a bright color, and a darker version of the background color instead of black. Right now you can either get black/white or dark/light, but not dark/white<br>
&lt;lea> q+<br>
&lt;dael> fantasai: Authors typically particular about hue and less about brightness. If you end up with navy blue text on white would author be happy? If Chrome gives navy blue but Safari gives dark maroon and FF does charcol gray, I feel like authors will be unhappy<br>
&lt;fantasai> s/white/cream/<br>
&lt;dael> TabAtkins: Our hope is distance from black and white is small enough that you can't have enough variation to clash on the page. And if they are unhappy you can say max.<br>
&lt;dael> fantasai: They may not be unhappy b/c looks good where they test<br>
&lt;dael> TabAtkins: Our hope is with the maximum divergence all results should be generally acceptable<br>
&lt;dael> fantasai: Let's say gray. People are sensitive to warm or cool. If some UA pick warm and some cool people will have sensitivity to what. What's benefit to allow gray be warmer or cooler? How far off can you be to get a benefit and no problem?<br>
&lt;dael> TabAtkins: Point is we want to experiment. We think this ability is valuable. There's a lot of work in experimentation and theory to figure out what's best. The hope is we eventually can write an algo. Hope is give authros something predictable for now that lets us play around to find the right spec<br>
&lt;Rossen_> q<br>
&lt;dael> fantasai: And you're arguing this should be default? We should create this difference in hue b/c that's a better default?<br>
&lt;lea> +q another issue is that if one browser returns black/white and another dark/light, this is practically unusable (without max)<br>
&lt;dael> TabAtkins: Yes. We believe the little bit of exporation will be acceptable as a default even if it's slightly different across browsers<br>
&lt;dael> lea: At first I quite liked proposal, but thinking more one issue is that if one browser gives always black/white and other does dark/light then the authors that want dark/light can't do anything with the values<br>
&lt;Rossen_> ack lea<br>
&lt;dael> lea: Even with relative color trying to think what math to use get light or dark on browsers that do black/white. I can do it with alwyas blakc/white<br>
&lt;dael> lea: Also, remember in graphic design more common to want white text on a bright color bg. If the color is so light it needs dark text it's more common to want not black. Current proposal doesn't let you distinguish and mix and max<br>
&lt;dael> TabAtkins: White is a valid light color<br>
&lt;dael> florian: But author can't ask for it<br>
&lt;dael> lea: What I'm saying is I want white if it would work and a dark color instead of black. Can't spec that intent i don't know if that's as wide spead as I remember. No way to spec that<br>
&lt;dael> TabAtkins: That can't be done in any syntax we discussed except listing explicit colors. Unless browser is smart enough to know<br>
&lt;dael> lea: If it returns white and black you can use max<br>
&lt;Rossen_> q?<br>
&lt;dael> florian: If as an author you want to manipulat eyou put in 'max'. If you want to tweak ask for the predictable thing<br>
&lt;dael> florian: I'm skeptable that the distance from white/black is small enough to be useful but not so large it can be bad<br>
&lt;lea> what I was referring to: lch(from var(--color) clamp(.2, l, 1) c h)<br>
&lt;astearns> +1 to florian's last point<br>
&lt;dael> TabAtkins: We're hoping it's not. Remember the falure case if we're wrong is we change the default to black/white<br>
&lt;fantasai> +1 to florian's point<br>
&lt;dael> Rossen_: I'd like to start getting to a resolution if we can<br>
&lt;Rossen_> ack fantasai<br>
&lt;florian> q+<br>
&lt;dael> fantasai: I have concerns about interop and suitability of automatic algo. I don't think it should be default, but I understand chrome has ideas to experiement. I don't think experiment is harmful if not shipping. I would prefer to spec black/white, add a note we're experiementing with other values, and let chrome experiment as a prototype<br>
&lt;lea> q?<br>
&lt;lea> q+<br>
&lt;dael> fantasai: If they get buy-in from dev community that they want the new behavior we can move. I don't think I'd want to spec UA magic at this point<br>
&lt;dael> TabAtkins: Issue with current channels is it's by definition people clued into the topic. if people are clued in they can do color manipulation on their own. We believe there is play to offer the general dev audience and there's not room in the channels we have for that<br>
&lt;Rossen_> ack florian<br>
&lt;dael> florian: One of the downside of fantasai's comment is Chrome wants a signal from authors that will mess with colors that they're going to do that. If we do the way fantasai suggested we don't have that signal. But you can maybe look for authors doing more with it<br>
&lt;dael> lea: I think what fantasai desc makes sense. Worried about interop when leaving to UA. If chrome experiments and gets results authors like we can add additional behavior for it.<br>
&lt;dael> lea: and/or we can introduce additional assurances to make sure result is predictable. Has to maintain same hue or something, but reduces innovation. I don't know what experiements they have in mind<br>
&lt;dael> TabAtkins: We don't know yet either. we'll play to see what gets good results<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack lea<br>
&lt;dael> lea: Why not ship the simple version now, experiement, and add the new one later<br>
&lt;dael> TabAtkins: If it is something else it's by definition not going to be the first thing people reach for when they don't know what they want. The hop here is we can make the default good for people who just want a good text color. People who know color theory and want to play should be able to do that.<br>
&lt;Rossen_> q?<br>
&lt;dael> TabAtkins: The goal here precludes a switch for later. If this will be worthwhile it needs to be a default<br>
&lt;dael> Rossen_: And TabAtkins what you're saying is the additive behavior...what's the difficulty there? If we resolve on black/white now and add the 'max' keyword to do more?<br>
&lt;schenney> q+<br>
&lt;dael> TabAtkins: The 'mx' keyword forces you into black and white. All other values will be slightly-less contrastly. Also, it's that if you don't know how colors work, which most people don't, you're not going to reach for an optional keyword?<br>
&lt;dael> lea: Doesn't that depend on name?<br>
&lt;dael> TabAtkins: All optional keywords are treated as less default<br>
&lt;dael> fantasai: I see TabAtkins's point<br>
&lt;Rossen_> ack schenney<br>
&lt;dael> schenney: florian made an excellent point. If you wish to experiment having the default be to play and the max keyword it makes it rediculously easier to experiment. You get good signal. If you only have black/white it's very hard to infer what people want. For that reason the proposal from TabAtkins is best for a long term answer<br>
&lt;lea> TabAtkins: yes, optional keywords are used less often; but my point was that whether authors that don't know about color theory reach for the keyword depends on the keyword name. Like, the keyword doesn't need to be worded in such a way that it depends on color theory<br>
&lt;dael> florian: I'm not too hot for the proposal, but there is a chance it's useful and low risk if we define the distance short enough. If it's too far we'll get feedback and maybe we end on black/white<br>
&lt;TabAtkins> yeah we're thinking that, like, an #eee or an #eef rather than a pure #fff, very short distance<br>
&lt;dael> Rossen_: Let's see if we can resolve on TabAtkins's proposal. Other comments?<br>
&lt;dael> fantasai: It may be nice to start with mroe restricted audience trials to see if you get answers in those environments first.<br>
&lt;dael> Rossen_: how does that change the proposal?<br>
&lt;dael> fantasai: I think I would feel more postivie about it if there were positive signals in a restricted community<br>
&lt;dael> TabAtkins: We know for a fact that very often people reach for slightly off-white and off-black. That's from color design bible. Do #111 or #eee. That suggests we should be slightly off white/black for this. but it doesn't tell us exact value<br>
&lt;lea> q+<br>
&lt;dael> florian: Black and white are valid answers to if experiment isn't conclusive we can ship black/white<br>
&lt;Rossen_> ack *<br>
&lt;Rossen_> ack lea<br>
&lt;fantasai> those are both neutral grays...<br>
&lt;fantasai> but ok<br>
&lt;dael> lea: What TabAtkins  is saying is true. It is common designers use off-white instead of white. Text size, font, weight, etc...the CSS function can't know it's context<br>
&lt;dael> TabAtkins: A lot of these factors could be inferred<br>
&lt;dael> lea: Are you suggesting we spec a color fucntion that's different based on what property it's in? That's not how color functions work<br>
&lt;dael> TabAtkins: I'm saying it could and we'll figure out to what extent we may want them to differ<br>
&lt;dael> Rossen_: We've talked for 30 minutes and I think we're starting to circle. We can try and resolve or go back to the issue to discuss more since this is a newer proposal.<br>
&lt;dael> TabAtkins: The exact proposal is new, but we have been discussing this area since NY F2F<br>
&lt;dael> lea: Agree. What about a straw poll<br>
&lt;dael> Rossen_: What are the options?<br>
&lt;dael> lea: 1. function returns black/white by default<br>
&lt;astearns> Returning a single non-b/w color based on the input color is one thing. Returning several different colors from one input color based on where the function is used is VERY different. You should make that explicit in the proposal if that is the case.<br>
&lt;dael> lea: 2. function returns dark/light be default and the 'max' keyword for black/white<br>
&lt;dael> s/be/by<br>
&lt;fantasai> 0, defer to jensimmons who unfortunately isn't here...<br>
&lt;TabAtkins> When the output space is wide, the difference matters more. When the output space is a small radius aroudn black/white, we believe it's probably fine.<br>
&lt;schenney> 2<br>
&lt;TabAtkins> 2<br>
&lt;florian> 2 (not a very strong opinion)<br>
&lt;iank_> 2<br>
&lt;astearns> 1<br>
&lt;lea> 1<br>
&lt;fantasai> Also! IIRC we'd resolved to require the "this is for text" vs "this is for background" keywords, is that being handled?<br>
&lt;smfr_> 2<br>
&lt;changseok> 1<br>
&lt;vmpstr> 2<br>
&lt;lea> fantasai: not for the MVP<br>
&lt;Rossen_> 2<br>
&lt;dholbert> abstain (no strong preference)<br>
&lt;emeyer> Abstain<br>
&lt;fantasai> lea, so which are we assuming? text or background?<br>
&lt;lea> fantasai: provided color is bg<br>
&lt;TabAtkins> input is background, output is text<br>
&lt;dael> Rossen_: We've got a clear signal for option 2<br>
&lt;dael> Rossen_: One of the things I didn't hear during discussion since this is a11y related- by returning black/white we are forcing more often higher contrast than user may prefer. Option 2 addresses this well.<br>
&lt;dael> Rossen_: Objections to function returns dark/light by default and the 'max' keyword for black/white<br>
&lt;dael> RESOLVED: function returns dark/light by default and the 'max' keyword for black/white<br>
&lt;dael> [agenda wrangling]<br>
&lt;dael> [waiting for Chris on #8543]<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9166#issuecomment-1709264221 using your GitHub account


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

Received on Wednesday, 6 September 2023 23:44:27 UTC