Re: [csswg-drafts] [css-values-4][css-color] Addition of `<color>` is way underspecified. (#8576)

The CSS Working Group just discussed ``[css-values-4][css-color] Addition of `<color>` is way underspecified.``, and agreed to the following:

* `RESOLVED: Colors don’t add; add a note asking for use cases and a warning specifying we might change in the future`

<details><summary>The full IRC log of that discussion</summary>
&lt;emeyer> chris: The original text about adding color was from the sRGB days and it assumes consistent color spaces<br>
&lt;emeyer> …It turns out nothing actually depends on this<br>
&lt;emeyer> …We could say colors don’t add, or we pick something good since there’s no backwards compatibility issue<br>
&lt;emeyer> …I propose the latter<br>
&lt;emeyer> …so I have everything I need to add to the spec<br>
&lt;dbaron> (you're sure smil animation doesn't depend on this?)<br>
&lt;fserb> q+<br>
&lt;emeyer> TabAtkins: I’m unclear when it would be useful to do an additive animation to a color, I suspect we should just go the simplest route and say colors don’t add<br>
&lt;flackr> q+<br>
&lt;fserb> q-<br>
&lt;emeyer> chris: That is simple and easy, yeah<br>
&lt;emeyer> TabAtkins: Additive transforms make more sense, but colors seem a lot more integrated and meaningful<br>
&lt;fserb> +1 to tabatkins<br>
&lt;Rossen_> ack flackr<br>
&lt;emeyer> flackr: I commented on another issues that adding colors should be treated as composition of that color<br>
&lt;TabAtkins> composition certainly makes more sense than component addition<br>
&lt;TabAtkins> tho *which* composition is always a question<br>
&lt;emeyer> …This to me feels like the thing you’re trying to express when adding a color to another color<br>
&lt;chris> q+<br>
&lt;emeyer> …I think that interpretation solves the color-space question<br>
&lt;florian> q?<br>
&lt;emeyer> …Because it goes to the color space of whatever you’re compositing onto<br>
&lt;fantasai> https://www.w3.org/TR/web-animations-1/#effect-composition<br>
&lt;Rossen_> ack fantasai<br>
&lt;fantasai> enum CompositeOperation { "replace", "add", "accumulate" };<br>
&lt;emeyer> fantasai: The addition of values is defined in web animations and there’s a composite operation that lets you change how you’re doing it<br>
&lt;fantasai> https://www.w3.org/TR/web-animations-1/#the-compositeoperation-enumeration<br>
&lt;emeyer> …That’s where this whole definition came from<br>
&lt;emeyer> …It seems like replacement is not what’s intended<br>
&lt;Rossen_> ack chris<br>
&lt;emeyer> …I don’t know that defining this as replacement is what we want, long-term<br>
&lt;TabAtkins> I think the Web Anim use of the word "composited" is unrelated to the "composition" that flackr just mentioned<br>
&lt;emeyer> chris: What was described as compositing on top of is interpolation, which is defined a sentence earlier<br>
&lt;emeyer> …So in one case, we point off to the interpolation definition, and the other case, we say you can’t do it<br>
&lt;fantasai> TabAtkins, yes, but follow that link<br>
&lt;fantasai> It's switching between replace/add/accumulate<br>
&lt;emeyer> TabAtkins: Rob is describing compositing, not interpolating<br>
&lt;emeyer> chris: The only difference is the color space you do the compositing in, but it’s still interpolation<br>
&lt;fserb> q+<br>
&lt;TabAtkins> fantasai, yes, that's still not what flackr is talking about<br>
&lt;fantasai> no, it's not<br>
&lt;emeyer> flackr: You do get weird interpolations with opacities involved<br>
&lt;fantasai> I'm saying, that's what's defining that replacement and addition should be different<br>
&lt;TabAtkins> they're different *if* you define an addition operation. if you don't, they're the same<br>
&lt;emeyer> fserb: I think we shoudl step back and focus on the first question<br>
&lt;fantasai> There was an assertion that the definition of addition isn't used<br>
&lt;emeyer> …My feeling is that even if we don’t have a use case right now, we should lean toward not adding<br>
&lt;fantasai> and it is, in WA1<br>
&lt;emeyer> …Just in case we find reasons to do it in the future<br>
&lt;TabAtkins> it's not used *in practice*, chris said<br>
&lt;emeyer> chris: I tend to agree that if we don’t have a use case, we shouldn’t spec it<br>
&lt;lea> agreed that not adding is easier to extend in the future vs some random addition algorithm<br>
&lt;flackr> q+<br>
&lt;emeyer> …I don’t think a lot of thought went into this bit of the spec because it didn’t get exercised<br>
&lt;emeyer> fantasai: Are you saying there’s no use case, or that there’s no room for it in CSS?<br>
&lt;emeyer> chris: That there’s no use case<br>
&lt;fserb> ack fserb<br>
&lt;fantasai> s/no room for it/no way for the definition to get used/<br>
&lt;Rossen_> ack fserb<br>
&lt;Rossen_> ack flackr<br>
&lt;emeyer> flackr: I do think there are use cases, like modifying underlying color by some amount as with transforms<br>
&lt;emeyer> …I think the risk of not doing tsomething now is that it could become a breaking change in the future<br>
&lt;emeyer> …I think if we assume they don’t add, then the result is you get the second color, as it replaces the first<br>
&lt;emeyer> chris: I believe that’s correct<br>
&lt;emeyer> Rossen_: So this is really a what-if, there’s no use case<br>
&lt;emeyer> …So what do we do?<br>
&lt;emeyer> …We can remove it from the spec until someone comes up with a use case<br>
&lt;emeyer> …We could leave it as is<br>
&lt;lea> q?<br>
&lt;emeyer> flackr: I’m very much against the current behavior<br>
&lt;emeyer> chris: Same here<br>
&lt;emeyer> lea: Agreed<br>
&lt;TabAtkins> it wasn't underspecified at the time, fwiw - back when it was written colors were specified as sRGB<br>
&lt;emeyer> Rossen_: What if we bring all of it back to the whiteboard, and maybe find some use cases in the meantime?<br>
&lt;TabAtkins> clearlly not something we want to do now<br>
&lt;emeyer> …How does that sound?<br>
&lt;fserb> I'm good with this too<br>
&lt;emeyer> chris: So we’re effectively resolved they don’t add now, and can change it later<br>
&lt;emeyer> TabAtkins: Plus add a note saying we’d like use cases<br>
&lt;emeyer> fantasai: And that we might change it in the future<br>
&lt;emeyer> Rossen_: Objections to the note and warning?<br>
&lt;emeyer> plinss: I’m a little concerned about not doing things when we don’t have use cases<br>
&lt;fserb> q+<br>
&lt;emeyer> …What’s the justification for not doing it?<br>
&lt;emeyer> …Authors might come up with cool stuff once a possibility is out there<br>
&lt;emeyer> TabAtkins: There’s a lot of ways of defining addition, and without use cases, it’s an arbitrary choice<br>
&lt;flackr> add rgb(0, 0, 0, 0.1) /* darken */<br>
&lt;emeyer> …If we decide that for now we don’t add at all, authors can still get what they want by doing their own blending<br>
&lt;emeyer> …We don’t have an obvious behavior to bless here<br>
&lt;fantasai> +1<br>
&lt;emeyer> fserb: There are a lot of axes you can change colors on, none of which are “add"<br>
&lt;emeyer> Rossen_: I didn’t hear objections, and peter’s concern seems addressed<br>
&lt;TabAtkins> flackr: reasonable to argue for the "just composite it" in the issue, if you do think we should do that<br>
&lt;emeyer> RESOLVED: Colors don’t add; add a note asking for use cases and a warning specifying we might change in the future<br>
</details>


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


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

Received on Wednesday, 31 May 2023 16:48:30 UTC