Re: [csswg-drafts] [css-color-4] Channel clipping breaks author expectations, especially when using 'perceptually uniform' spaces (#9449)

> This is a bit of a contrived example, but if we take `color(display-p3 1 0.25 0.3)`, clipping gives `#ff1b43` and the spec algorithm gives `#ff4050`. On a `#242424` background, the spec's result (which is noticeably, if not hugely, lighter) [passes](https://webaim.org/resources/contrastchecker/?fcolor=FF4050&bcolor=242424) the WCAG AA contrast requirement for normal text while the clipped result [fails](https://webaim.org/resources/contrastchecker/?fcolor=FF1B43&bcolor=242424).

I think flaws can be found in both clipping and chroma reduction (CSS's recommendation). You can also find arguments for both cases depending on which cases you choose to highlight, but when we are talking about contrast, chroma reduction is simply easier to work with. Chroma reduction will not always be the best if we are talking about displaying images, it's an entirely different use case. This is why I think it is important to pin down exactly what CSS is trying to solve. When you are arguing multiple, incompatible problems, it is difficult to come to a resolution.

This shows what happens with various approaches. The case below is using high chroma (0.4 in OkLCh) and a lightness range of 0 - 1 and a hue range of 0 - 360.  The first is clipping, the second is chroma reduction, and the third is the experimental Chromium approach which is kind of a middle ground (gamut map to Rec 2020 and clip to lesser gamuts).

![clip-constant-chroma](https://github.com/w3c/csswg-drafts/assets/1055125/c98cd01a-c69a-47d0-8556-12d855eeb99d)

![chroma-reduction-constant-chroma](https://github.com/w3c/csswg-drafts/assets/1055125/aae3dffd-fd6d-4a4e-9e67-3c5ef291fd4a)


![chromium](https://github.com/w3c/csswg-drafts/assets/1055125/8041ab42-5151-47e3-895a-9acd52f73b3c)







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


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

Received on Wednesday, 27 March 2024 21:01:09 UTC