You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tagging Images 4 for fixing; I'm aware that currently, Images 4 has the same gradient stuff as Images 3.
Two things in the CSS Images definition of gradients hinder integration with CSS Color 4:
The <<color>> token links to CSS Color 3, which only allows sRGB values. CSS Color 4, which is the current work, allows other RGB spaces, CMYK, Lab, and LCH.
Between two color stops, the gradient line’s color is interpolated between the colors of the two color stops, with the interpolation taking place in premultiplied RGBA space
which would force all colors to be
a) converted to sRGB, resulting in gamut mapping
b) interpolated in sRGB gamma-encoded space.
Suggested fixes are
Change the link for <<color>> to CSS Color 4, which is the current specification
State that for compatibility, color stops which are all in an sRGB space (this includes hsl, hwb, named colors) are interpolated in premultiplied sRGBA (this gives a poor result, but is Web compatible)
Add an opt-in feature on gradients to select another color space. At minimum CIE XYZ (for linear-light blending) and CIE Lab (for perceptually uniform linear interpolation) and CIE LCH (for perceptually uniform chroma-preserving angular interpolation) should be supported
In addition, the interpolation section of CSS Color 5 needs to define how premultiplied alpha is handled. For example in Lab or in XYZ, premultiplying all three component values will work; in LCH, premultiplying hue would change the hue so should not be done.
I'm happy to help with examples (CSS, color calculations, rendered results) of interpolated gradient lines which involve non-sRGB stops.
Tagging Images 4 for fixing; I'm aware that currently, Images 4 has the same gradient stuff as Images 3.
Two things in the CSS Images definition of gradients hinder integration with CSS Color 4:
The
<<color>>
token links to CSS Color 3, which only allows sRGB values. CSS Color 4, which is the current work, allows other RGB spaces, CMYK, Lab, and LCH.the section coloring the gradient line says that
which would force all colors to be
a) converted to sRGB, resulting in gamut mapping
b) interpolated in sRGB gamma-encoded space.
Suggested fixes are
<<color>>
to CSS Color 4, which is the current specificationIn addition, the interpolation section of CSS Color 5 needs to define how premultiplied alpha is handled. For example in Lab or in XYZ, premultiplying all three component values will work; in LCH, premultiplying hue would change the hue so should not be done.
I'm happy to help with examples (CSS, color calculations, rendered results) of interpolated gradient lines which involve non-sRGB stops.
@tabatkins @fantasai @LeaVerou
The text was updated successfully, but these errors were encountered: