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

`colorjs` doesn't support relative color syntax.

What I am mostly interested in is how colors behave depending on the notation.

With relative color syntax you can change the notation.
A value first described with `oklch` might end up being used in `color(from ... srgb r g b)`.

https://codepen.io/romainmenke/pen/GRbgMPj

<img width="554" alt="Screenshot 2024-07-10 at 16 55 09" src="https://github.com/w3c/csswg-drafts/assets/11521496/12db8edd-57b0-46fb-a821-70445b4ddf4e">

I would still prefer that gamut mapping was applied to all CSS color values and that it doesn't depend on how a value is declared.

With another way to opt-in/out of clipping/gamut mapping for all CSS colors.

----------

Also concerned about mapping to rec2020 and then clipping.

Is there any clipping or gamut mapping that happens before any other interpolation?
Or is clipping/gamut mapping always the last step as intended by the current specification text?

Clipping literally throws away information and in a way that does not preserve the balance between channels.

i.e. these gradients should render differently as they should render the hue circle in opposite directions.

```css
#a {
  background: linear-gradient(to right in oklch longer hue, oklch(from color(srgb 1 -0.01 0) l c h), red 100%);
}

#b {
  background: linear-gradient(to right in oklch longer hue, oklch(from color(srgb 1 0 -0.01) l c h), red 100%);
}
```

Chrome (with the flag) shows pure red, but not by design given that the implementation is experimental :D

https://codepen.io/romainmenke/pen/dyBPZoG?editors=1100

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


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

Received on Wednesday, 10 July 2024 15:59:59 UTC