Re: [csswg-drafts] [css-color-4] Move gamut mapping to a future spec (#8444)

> I think part of the confusion lies on the fact that there are two types of out-of-gamut:
> 
> a) Out of gamut of the specified color format (e.g. rgb(from red, calc(r * 1.05) g b) is OOG for sRGB, even though it's not OOG for a P3 display)
> 
> b) Out of gamut of the display device (e.g. even an sRGB color like red could be OOG for a 2013 MacBook Air, whose gamut is approximately 60% of sRGB).

Thanks so much Lea. This clears things up quite a bit. The crux of the confusion are [these tests](https://github.com/web-platform-tests/wpt/blob/2bb60461aad0075ca8e1ae08aa836f06b4870d49/css/css-color/parsing/gamut-mapping.html), which, if I understand correctly are an instance of a) and not b)? 

> I think (@svgeesus please confirm) that we (editors of CSS Color) are happy to have intermediate calculations not be gamut mapped, since most of them should happen within infinite gamut spaces anyway. What matters is gamut mapping for display.

If both these things are true, then the tests are invalid, no? The gamut mapping will happen later in the pipeline, or even not at all if the display device is capable of colors outside the sRGB gamut?

> [8.](https://w3c.github.io/csswg-drafts/css-color-4/#convert-hslhwb) If dest cannot represent [out of gamut](https://w3c.github.io/csswg-drafts/css-color-4/#out-of-gamut) colors, for example [hsl](https://w3c.github.io/csswg-drafts/css-color-4/#valdef-hsl-hsl) or [hwb](https://w3c.github.io/csswg-drafts/css-color-4/#valdef-hwb-hwb), then col2 must be [css gamut mapped](https://w3c.github.io/csswg-drafts/css-color-4/#css-gamut-mapped).
>
> That is it. All other color space conversions can, and must, accomodate results which are out of gamut for the color space used.

So, we _should_ be doing something similar to [the aforementioned tests](https://github.com/web-platform-tests/wpt/blob/2bb60461aad0075ca8e1ae08aa836f06b4870d49/css/css-color/parsing/gamut-mapping.html), but with `hsl` and `hwb` as output color spaces since they are simply incapable of representing out-of-gamut color (as opposed to not being able to display out-of-gamut colors)? Are `hwb` and `hsl` the only colors spaces for which that is the case?

The concern raised in this issue was primarily about interoperability, since Safari and Chrome are beginning to ship `color-mix()`. If we can resolve the issue about the appropriateness of the above tests, we can defer larger discussions about gamut mapping to pre-existing threads (i.e. https://github.com/w3c/csswg-drafts/issues/7653 and https://github.com/w3c/csswg-drafts/issues/7610).



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


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

Received on Tuesday, 21 February 2023 22:45:45 UTC