Open LeaVerou opened 4 months ago
I actually just realized a pretty important reason to do this: it means the result can be consistent regardless of the conversion path.
For example, let’s take a conversion from sRGB to LCh. The conversion path using XYZ D65 as a connection space is as follows: sRGB → Linear sRGB → XYZ D65 → XYZ D50 → Lab → LCH
Suppose we’re converting white
.
white
in XYZ D50 is color(xyz-d50 0.9643 1 0.8251)
which is lab(100 none none)
.
a and b have no analogous components, so when converted to LCh they are converted to lch(100 0 0)
.
However, if we consider them an analogous set, then can be converted to lch(100 none none)
.
The CSS Working Group just discussed [css-color-4] Expand the concept of analogous components to analogous sets of components to minimize `none` → `0` conversions
, and agreed to the following:
RESOLVED: Also any set of analogous components are
(This came out of my comment here: https://github.com/w3c/csswg-drafts/issues/10151#issuecomment-2052685363 )
Currently, css-color-4 defines that
none
values will be carried forward to analogous components. Basically, even when converting to different color spaces, if there are analogous components, they will becomenone
.Essentially what this does, is attempt to divide the components into rough sets of dependencies and try to preserve author intent as much as possible. Sure, they’re not entirely orthogonal, and e.g. tweaking hue in HSL does affect chroma and lightness in oklch, but it's the lesser of two evils, the other evil being converting
none
to0
.To that goal, I can see a few improvements we can make to minimize
none
→0
conversions even more:oklch(50% none none)
tolab
yieldslab(42 none none)
.Not sure if this can be considered editorial, or we'd need WG resolution. @svgeesus ?