-
Notifications
You must be signed in to change notification settings - Fork 711
[css-color-4] Expand the concept of analogous components to analogous sets of components to minimize none
→ 0
conversions
#10210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
none
→ 0
conversionsnone
→ 0
conversions
none
→ 0
conversionsnone
→ 0
conversions
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. Suppose we’re converting |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> lea: mapping between components of analogous color spaces is well-defined in the spec<fantasai> lea: e.g. mapping green to green, ligthness to lightness, etc. <fantasai> lea: if analogous component exists in other color space, after conversion none is preserved <fantasai> lea: we convert none to zero, and then convert, and then put none back <fantasai> lea: want to expand the idea <fantasai> lea: if lightness is none and convert from labl to oklch <fantasai> lea: lightness is still none <fantasai> lea: but if lightness is a specific number and a/b are none they would become zero <fantasai> lea: what this concept defines is .. if you split the components into sets that correspond <fantasai> lea: then what remains is also analogous <fantasai> lea: so a+b is analogous to c+h <fantasai> lea: this mainly makes a difference for lab to lch <fantasai> lea: or colors where all are none <fantasai> lea: that would be an analogous set <fantasai> lea: that's logically consistent <dbaron> makes sense <fserb> q+ <lea> q? <fantasai> fserb: will you describe in the spec in those terms, or actually list all the combinations? <ChrisL> I think these analogous sets make sense <dbaron> (it doesn't sound to me like there's much of an explosion... I think) <fantasai> lea: combinatorial explosion. So anything that remains after subtracting the analogous components is (as a set) an analogous component <lea> PROPOSED RESOLUTION: Expand concept of analogous components to analogous *sets* of components. <fantasai> PROPOSED: The components that remain after removing the anlogous components are (as a set) an analogous component. <dbaron> (including all components being none being analogous for all color spaces) <fserb> +1 <fantasai> RESOLVED: Also any set of analogous components are |
@LeaVerou could you propose specific spec text? In particular I am not understanding "all components being none being analogous for all color spaces". |
I’ll need to think more about specific spec text but that sentence basically means that if all three components are |
@LeaVerou As proposed here, the gradient below would render Currently Chrome, Safari, and Firefox all render as a black to green gradient. .test {
background: linear-gradient(in oklab, rgb(none none none), green );
width: 200px;
height: 200px;
} |
Right, because they are converting |
I am unsure if
Because there are no analogous components between rgb and oklch, nothing is carried forward and re-inserted. Interpolating with black is correct as per the current specification. Or is there another part of the specification that also comes into play and that makes the current implementation incorrect? Is the proposed change (and resolution) still a change we can make given that there seems to be interop for the current specification? |
Yes, agreed. Hence this issue; the goal is to preserve
Not clear, but remains a possibility. |
(This came out of my comment here: #10151 (comment) )
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)
.none
#10203 )Not sure if this can be considered editorial, or we'd need WG resolution. @svgeesus ?
The text was updated successfully, but these errors were encountered: