According to the spec, the default color space for gradients should be oklab (if I understood correctly).
In Firefox and Safari it's srgb. In Chrome it seems to be oklab but if I set it to oklab explicitly and compare it doesn't seem to be identical with the default gradient.
@argyleink, am I wrong or is this a feature/bug in Chrome?
@matuzo Wow, it’s actually the case:
> If the host syntax does not define what color space interpolation should take place in, it defaults to Oklab.
https://www.w3.org/TR/css-color-4/#interpolation-space
But what about backward compatibility? My old ugly sRGB gradients aren’t supposed to change with the new browser releases.
@pepelsbey @matuzo Yes, it is definitely a problem (IMO) if they are changing the color interpolation space for existing code. Looking through Github issues, it looks like the original intent was to allow overriding an sRGB default, but then the Color spec was changed to make the default Oklab & require opting in to the "old behavior".
@svgeesus, can you confirm whether you really intended to change the rendering of existing gradient code?
(Also: any idea what space Chromium is using? )
@AmeliaBR @pepelsbey @matuzo The #CSSWG (not me, personally) did intend that, yes. Interpolation in gamma-encoded rgb spaces is not perceptually uniform, and the over-dark midpoint is rarely desirable. Often, extra stops are inserted to partly compensate.
We have done this before (substituting an overall better behavior), for example, underlining that doesn't obliterate descenders.
@svgeesus Yep. I was mad about the skip-ink underlines change, too. Made some content I'd only recently published pretty ugly.
The gradient changes will probably be more subtle, but I'm sure they'll cause some issues with people who've carefully combined multiple gradients, especially if they're also using filters or blend modes.
And they'll definitely make nonsense of past tutorial examples about how gradient color spaces work!
@svgeesus (And sorry for ending up tagging you in a whole flurry of posts on the topic, as I slowly tracked down the relevant discussions & decisions, which were no longer reflected in the changes section of the spec. I may have very strong opinions about spec changes that break previously cross-browser-compatible behavior. Even when we might all agree that it might be better in the long run, it's still opting in to cross-browser inconsistencies probably for years, beyond any broken content.)
@AmeliaBR Absolutely no need to be sorry.