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

My thoughts, most of which I have expressed before in the various discussions about this:

- The idea of interpolating same color space colors in their own color space has been proposed multiple times ([most recently by me](https://github.com/w3c/csswg-drafts/issues/4647#issuecomment-571165011)) and every time we eventually realize it's not a good idea. Consider interpolating between two P3 colors: we *really* don't want them to interpolate in gamma-encoded P3 space. 
- I don't think a `color-interpolation` switch is a good idea for a variety of reasons. a) Setting color interpolation on a per-element basis is too coarse. A single element may have rules that come from different stylesheets, with different ages and therefore assumptions. Given custom properties, even a single declaration could come from multiple stylesheets. b) What happens when `color-interpolation` is set to narrower spaces than the specified colors? How do you interpolate P3 colors in sRGB or Lab colors in P3 if they fall outside these gamuts?
- Are there any use cases beyond backwards compat for interpolating in any gamma-encoded RGB spaces? If not, we probably don't want to provide more rope for people to hang themselves. The default behavior, whatever we decide it should be, can be specified via `auto`. 
- I have some doubts about whether backwards compat in this case would make good interpolation by default prohibitive. There is precedent in changing existing widely deployed behavior when the new behavior was undeniably better in every case, for example when UAs enabled `text-decoration-skip-ink` by default. Similarly, when we switched gradient interpolation to premultiplied RGBA, gradients had already been widely deployed at that point. Note that any undesirable interpolation can always be overridden by adding more stops, so there is an escape hatch for the handful of authors in the world that may prefer the old behavior.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5833#issuecomment-786944986 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:17:14 UTC