Re: [csswg-drafts] [css-color] Add OKLab, OKLCH (#6642)

The CSS Working Group just discussed `OKLab OKLH`, and agreed to the following:

* `RESOLVED: Define gamut-mapping using OKLCH and OKLIE`
* `RESOLVED: For non-legacy color formats, use OKLAB for interpolation by default (instead of CIE LAB)`
* `RESOLVED: Add syntax to represent OKLAB and OKLCH colors`
* `RESOLVED: Add oklab() and oklch()`
* `RESOLVED: Add these as keywords to color-mix()`
* `RESOLVED: Add these to color adjustment functions also`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: OKLab OKLH<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6642<br>
&lt;fantasai> Chris: I gave a presentation on this, and documented my reasoning in depth<br>
&lt;fantasai> Chris: My first request is, in the gamut-mapping section, we use OKLCH instead of CIELCH<br>
&lt;fantasai> Chris: And we use OK delta E instead of ???<br>
&lt;fantasai> Chris: Because much less computational complexity<br>
&lt;fantasai> Chris: And also much better results in blue/purple region<br>
&lt;fantasai> Chris: I otherwise can't produce a good result that I like<br>
&lt;fantasai> Chris: I posted some results in the last few comments<br>
&lt;florian> q+<br>
&lt;fantasai> Chris: You'll need to use ??? because it uses display-3<br>
&lt;dbaron> s/???/CIE delta E/<br>
&lt;astearns> ack florian<br>
&lt;dbaron> (that was for the previous ???)<br>
&lt;fantasai> florian: I watched presentation, you made a compelling case<br>
&lt;lea> q?<br>
&lt;lea> q+<br>
&lt;fantasai> florian: The only worry is it's new, and some things maybe need to be discovered<br>
&lt;fantasai> florian: But overall seems compelling, including this first point<br>
&lt;fantasai> Chris: My thoughts also, which is why I put so much effort into it<br>
&lt;astearns> ack lea<br>
&lt;fantasai> Chris: IT's also been implemented in various libraries for JS, Python, etc. by now, so have more confidence now<br>
&lt;fantasai> lea: I have similar concerns as Florian, but given explanation that we primarily want to use it for gamma-mapping, it's OK<br>
&lt;fantasai> lea: ...<br>
&lt;fantasai> lea: So see no problem for having this<br>
&lt;fantasai> astearns: Is it implemented in any OSes?<br>
&lt;fantasai> chris: to my knowledge, no, only in color libraries<br>
&lt;fantasai> chris: but it is extremely trivial<br>
&lt;fantasai> astearns: so you don't expect objections from implementers?<br>
&lt;fantasai> chris: I do not<br>
&lt;fantasai> astearns: Anyone with gamut-mapping opinions?<br>
&lt;lea> s/lea: .../lea: If authors actually want to use the oklab() or oklch() functions instead of the established lab() and lch() ones, I suppose they have a reason, so I see nothing wrong with it either/<br>
&lt;fantasai> astearns: proposed resolution is to use OKLCH and OKLIE for gamut-mapping<br>
&lt;fantasai> RESOLVED: Define gamut-mapping using OKLCH and OKLIE<br>
&lt;lea> s/lea: I have similar concerns /lea: I had similar concerns /<br>
&lt;lea> s/OKLIE/OKLCH/<br>
&lt;fantasai> chris: In the interpolation section, currently say that legacy formats interpolate in sRGB and newer formats interpolate by default in CIE LAB<br>
&lt;fantasai> chris: would like to change that to OKLAB by default, because it will give better results<br>
&lt;fantasai> florian: I support this<br>
&lt;TabAtkins> +1 from me<br>
&lt;lea> No objection<br>
&lt;TabAtkins> "legacy" is anything defined in Color 3<br>
&lt;fantasai> smfr: If gradient uses legacy color at one end and non-legacy at the other end<br>
&lt;fantasai> lea: fancy new algorithm<br>
&lt;fantasai> smfr: spec should say that<br>
&lt;fantasai> lea: it does<br>
&lt;fantasai> astearns: any other comments?<br>
&lt;fantasai> RESOLVED: For non-legacy color formats, use OKLAB for interpolation by default (instead of CIE LAB)<br>
&lt;fantasai> chris: This gives us internal ability, but users can't use it<br>
&lt;lea> smfr: It is mentioned here: https://www.w3.org/TR/css-color-4/#interpolation-space<br>
&lt;fantasai> chris: So suggest to add oklab() and oklce() functions<br>
&lt;lea> s/oklce()/oklch()/<br>
&lt;fantasai> chris: keeping existing lab() and lch() functions as-is, since people are used to it<br>
&lt;fantasai> chris: so question is, should we add this, and also, what syntax?<br>
&lt;fantasai> astearns: If we're using interpolation, don't we need to add syntax for it anyway?<br>
&lt;lea> +1, if the browser implements it, it makes sense to expose it to authors too<br>
&lt;fantasai> to represent colors in the middle of interpolation, e.g.<br>
&lt;fantasai> florian: It does make sense to add it<br>
&lt;fantasai> florian: Only other possibility would be to use color()<br>
&lt;fantasai> chris: color() only takes rectangular forms, not polar form, and polar form is more useful here<br>
&lt;fantasai> florian: I support the suggestion, just want to understand alternatives<br>
&lt;fantasai> florian: If we add directly as a function, options are lab() and oklab(), or cielab() and lab()<br>
&lt;fantasai> florian: Given current tools report (unprefixed) lab as CIE LAB, Chris's suggestion seems to make sense to me<br>
&lt;fantasai> astearns: Anyone with concerns adding this at all?<br>
&lt;fantasai> +1 to add<br>
&lt;argyle> +1 to adding<br>
&lt;fantasai> astearns: Proposed resolution is to expose these by some syntax<br>
&lt;fantasai> astearns: Any objections?<br>
&lt;fantasai> smfr: So if you specify lab() colors, they'll interpret in oklab()? Is that OK?<br>
&lt;fantasai> chris: They would unless you ask them to interpolate a different color space<br>
&lt;fantasai> lea: We did discuss having two colors interpolate in their shared space, if any<br>
&lt;fantasai> lea: but that doesn't work well for RGB formats, because the interpolate badly in RGB<br>
&lt;fantasai> chris: In general you should see very similar results<br>
&lt;fantasai> astearns: Any other concerns to adding?<br>
&lt;fantasai> RESOLVED: Add syntax to represent OKLAB and OKLCH colors<br>
&lt;fantasai> astearns: OK, so next question is, do we like the oklab() and oklch() proposed syntax?<br>
&lt;fantasai> [silence]<br>
&lt;TabAtkins> Sufficiently okay with this. ^_^<br>
&lt;argyle> lol<br>
&lt;drott> :)<br>
&lt;fantasai> RESOLVED: Add oklab() and oklch()<br>
&lt;fantasai> chris: Do we add to color-mix()?<br>
&lt;fantasai> lea: that should be automatic<br>
&lt;fantasai> RESOLVED: Add these as keywords to color-mix()<br>
&lt;dbaron> One of the earlier OKLIE -> OKLCH corrections should have been "OKLIE" -> "OK delta E", I think.<br>
&lt;fantasai> chris: We have a color adjustment syntax, should be able to do that with OKLAB and OKLCH as well<br>
&lt;fantasai> astearns: proposed to add these to ???<br>
&lt;argyle> &lt;3 rts, `oklab(from #f0f l a b / 20%)` 👍🏻<br>
&lt;fantasai> RESOLVED: Add these to color adjustment functions also<br>
&lt;dbaron> s/???/relative color syntax/<br>
&lt;fantasai> astearns: fwiw, I would consider the last two reasonable to do under editor's discretion<br>
</details>


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


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

Received on Wednesday, 13 October 2021 16:24:09 UTC