[csswg-drafts] [css-color-5] lch/lab out of gamut mapping (#6668)

surma has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] lch/lab out of gamut mapping ==
(I tried to figure out if gamut mapping is prescribed anywhere, but couldn’t quite get clarity. Please let me know if I missed something in the specs here.)

Safari TP (I’m using TP 132) supports `lab()` and `lch()` but the gamut mapping they utilize is, in my opinion, unexpected. Specifically, any value with 0% lightness can end up being quite colorful if the remaining parameters are big enough. Mathematically, that makes sense: `lch(0% 100 0)` maps to `rgb(37.59% -21.03% 3.46%)`. Safari now performs clamping to gamut map, using `rgb(37.59% 0% 3.46%)` as the rendering color.

<img width="898" alt="Screen Shot 2021-09-22 at 16 44 40" src="https://user-images.githubusercontent.com/234957/134376880-5ff6471a-93e8-48fe-a1dd-6601505fcd5d.png">

Similar unexpected behavior can be triggered with `lab()`.

I wonder if it would be appropriate, at least for color spaces that model “lightness” to be a bit more prescriptive on how gamut mapping should work, i.e. that L=0 can only result in black.

cc @argyleink 





Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6668 using your GitHub account


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

Received on Wednesday, 22 September 2021 15:46:51 UTC