[csswg-drafts] [css-color][css-images] Interpolation method / color space that favors chroma over lightness (#10135)

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

== [css-color][css-images] Interpolation method / color space that favors chroma over lightness ==
Current implementations clip out of gamut colors, which happens to produce darker but more vibrant colors in some cases.

This can easily be seen as a feature instead of a bug.

The current specifications are all clear that clipping should not be applied and that gamut mapping by reducing chrome in oklch is the intended method to make colors displayable.

That it is easily doable with clipping does mean that authors are playing around with and are finding a use for the incorrect behavior.

-----------

Is there a broad use case for interpolating in such a way that colors are as vibrant as possible between colors?

Is this useful for darker and/or less vibrant gradients?

I know that @argyleink has played around with this a lot, maybe he can share some more insights?

Authors can manually define extra color stops to have the desired effect, but that isn't trivial.

------------

Has there been any research into this?

The properties that seem to be favored:
- `oklch` has a good distribution of hue's, while `hsl` is a mess.
- `hsl` goes all over the place from very dark (blue) to very bright (yellow). It must preserve lightness better than `hsl`.
- perceived vibrance should be the same throughout the gradient.

-----

Some quick examples that illustrate how interpolating in `oklch` with out of gamut colors can produce visually nice results.

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

<img width="1470" alt="Screenshot 2024-03-25 at 19 16 27" src="https://github.com/w3c/csswg-drafts/assets/11521496/ca18f65b-4331-4424-aba0-0e879a2c39a2">


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


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

Received on Monday, 25 March 2024 18:38:16 UTC