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

I'll counter your second example with this:
```css
#div1 { background: lch(75% 67 180deg); }
#div2 { background: linear-gradient(lch(75% 67 180deg) lch(75% 101 82deg));
#div3 { background: lch(75% 101 82deg); }
```
Placed together, an author might reasonably expect the middle div to interpolate smoothly between div1 and div3 - the end colors are the same, after all. But if interpolation is in sRGB, it won't - both colors are outside the sRGB gamut, although within the `display-p3` gamut. So if displayed on an iPhone or Macbook, there would be a sharp jump in color as `div2` immediately converts the colors used in the gradient - including the colors at both ends - to sRGB.

I can't demonstrate this in a browser, but if you go to https://bfo.com/publisher/?job:I2eInQj00J2BBJIv#pdf, download the generated PDF and view it in Acrobat (which correctly interpolates gradients in Lab - you won't see this in other PDF viewers, including the one in your browser or macOS Preview) on a wide-gamut display such as a macbook, you'll see the gradient on the right has a hard boundary 1/3 and 2/3 of the way down. That's the effect I'm talking about.

(note the interpolation is otherwise fairly similar, despite the left gradient being LCH and the right sRGB, and the gradient covering a full 100° of hue. I just picked two random out-of-gamut colors, so no idea how representative this is)

Clearly neither solution is perfect and obviously there's no question this will be configurable - the only issue is which default is the least surprising.

I view sRGB is the option of last resort - it's guaranteed to be supported, but it's gamut is well below the majority (caution: assumption detected) of devices in use today. I just don't think we should be designing around it at this stage.

Either way I think we've both staked our respective positions out quite clearly, which is a good start. I'd welcome some other viewpoints on this.


-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5833#issuecomment-786890536 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 20:58:26 UTC