Re: [csswg-drafts] [css-images-4] Consider allowing gradients to include a color space for interpolation to take place in (#5833)

> WebKit interpolates a gradient in the so-called "Extended sRGB" color-space, which is just sRGB without the clamping and in the negative it is sign-reversed in the negative. 

Yes. As a means to store colors internally, for example, that is totally fine and avoids gamut mapping (and there is hardware support for it).

In general though interpolating on gamma-encoded colors will give you muddy midpoint colors. Legacy sRGB gradients have that already. I'd like to avoid it for non-legacy colors which don't have the Web-compat issue.

The better options are:

1. Linear light (either linear-light sRGB, P3, etc or equivalently and more agnostic, XYZ). That avoids the mud The midpoint is not perceptually in the middle, though
2. Perceptually linear like Lab (or more modern alternatives like ICtCp, Jzazbz, OKLab) where the midpoint color is clearly exactly between the two stops
3. Perceptually linear and chroma-preserving polar spaces like LCH (etc) where the gradient between two very dissimilar hues follows a rainbow rather than passing close to grey.

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


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

Received on Friday, 26 February 2021 23:15:03 UTC