Re: [csswg-drafts] [css-color-4] Achromatic colors converted to hue-ish spaces should treat hue as "missing", not NaN (#6107)

The CSS Working Group just discussed `Achromatic color conversion`, and agreed to the following:

* `RESOLVED: Accept proposal to have 'none' / NaN represent missing channel`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Achromatic color conversion<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/6107<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6107<br>
&lt;fantasai> chris: Several situations where polar color can have undefined hue<br>
&lt;fantasai> chris: e.g. gray, it doesn't have a chroma so it doesn't have a hue angle<br>
&lt;TabAtkins> proposal: https://github.com/w3c/csswg-drafts/issues/6107#issuecomment-929390142<br>
&lt;fantasai> chris: this can occur quite a bit<br>
&lt;fantasai> chris: in code this is often represented as Not A Number<br>
&lt;fantasai> chris: if interpolating, ifyou don't have a hue and the other color has a hue, then you take that hue<br>
&lt;fantasai> chris: so it's not the same as picking a random hue<br>
&lt;fantasai> chris: There was a bunch of discussion<br>
&lt;fantasai> chris: and the agreement was to do it like that<br>
&lt;fantasai> chris: which has knock-on effects in OM<br>
&lt;fantasai> chris: but the question is, what do we return<br>
&lt;fantasai> chris: is it NaN or missing or what<br>
&lt;fantasai> TabAtkins: Proposed that a color can be missing any of its components<br>
&lt;fantasai> TabAtkins: Author can specify with 'none'<br>
&lt;fantasai> TabAtkins: if interpolating between two colors and one has 'none', it takes the other side's value the entire time<br>
&lt;fantasai> TabAtkins: this is similar to behavior with premultiplied alpha<br>
&lt;fantasai> TabAtkins: if you either transition between two colors that are missing a channel<br>
&lt;fantasai> TabAtkins: treat that as an error<br>
&lt;fantasai> TabAtkins: reflecting this, in CSS syntax it's a keyword<br>
&lt;fantasai> TabAtkins: typedOM reflects that keyword<br>
&lt;fantasai> TabAtkins: in color API, unclear whether we want to reflect as null or NaN<br>
&lt;fantasai> TabAtkins: null is more ideomatic in WebPlatform<br>
&lt;fantasai> TabAtkins: but in other color APIs tend to use NaN<br>
&lt;fantasai> TabAtkins: Nan is more infectious<br>
&lt;fantasai> TabAtkins: so if trying to combine NaN with other number, get Nan<br>
&lt;fantasai> TabAtkins: I think Chris and Lea prefer NaN<br>
&lt;fantasai> TabAtkins: so proposal is to go with that for the missing color channel<br>
&lt;fantasai> fantasai: So what happens if you specify none for a channel that can't handle it?<br>
&lt;fantasai> TabAtkins: set to zero<br>
&lt;fantasai> Rossen_: any objections?<br>
&lt;fantasai> RESOLVED: Accept proposal to have 'none' / NaN represent missing channel<br>
&lt;fantasai> smfr: Do we have to parse NaN in &lt;number> context?<br>
&lt;fantasai> TabAtkins: no, it's only useful as a keyword in calc()<br>
&lt;fantasai> TabAtkins: math functions can see NaN along with infinity, e, and pi<br>
&lt;fantasai> smfr: So no need to construct NaN as color input anywhere?<br>
&lt;fantasai> TabAtkins: if NaN tries to escape calc(), it gets censored into infinity<br>
&lt;fantasai> TabAtkins: which gets clamped by the range of that context<br>
&lt;fantasai> TabAtkins: so no HSL with NaN<br>
&lt;TabAtkins> hsl(calc(NaN * 1deg), 50%, 100%)<br>
&lt;TabAtkins> ^^^ just renders as an arbitrary hue, whatever the largest angle you can hold is<br>
&lt;fantasai> Rossen_: OK, let's end here. Thanks everyone for attending.<br>
</details>


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


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

Received on Wednesday, 29 September 2021 17:00:48 UTC