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
{{ message }}
Repository navigation
[css-color-4] Drop If H is missing, a = b = 0 in 9.6? #14530
Or maybe make this only apply when displaying a color, same as gamut mapping?
In principle it makes sense that a color with a none hue displays as achromatic instead of whatever color happens to be 0deg.
Making this a function of display means that interpolation, relative color, ... all still work as expected and preserve c.
On my end the none hue was already converted to 0 at this point as my implementation didn't record the missing hue beforehand.
So cos(0) and sin(0).
Aside: these cases with none and conversions from polar to rectangular and back always have a sharp edge somewhere. Really tricky to pick the right trade-offs :)
Okay so oklch(60% 0.2 none)becomes oklab(60% 0.2 0) with all the chroma shoved into the a axis, giving a deep magenta.
Which then round-trips to oklch(60% 0.2 0), preserving the chroma value it had before.
Aside: these cases with none and conversions from polar to rectangular and back always have a sharp edge somewhere. Really tricky to pick the right trade-offs :)
Activity
romainmenke commentedon Sep 30, 2026
Or maybe make this only apply when displaying a color, same as gamut mapping?
In principle it makes sense that a color with a
nonehue displays as achromatic instead of whatever color happens to be0deg.Making this a function of display means that interpolation, relative color, ... all still work as expected and preserve
c.svgeesus commentedon Sep 30, 2026
Yes, that seems reasonable. It also aligns the spec with implementations, without harm and with a benefit.
svgeesus commentedon Sep 30, 2026
So in the remaining pseudocode:
what is the value of cos(
none) and sin(none) ?romainmenke commentedon Sep 30, 2026
On my end the
nonehue was already converted to0at this point as my implementation didn't record the missing hue beforehand.So
cos(0)andsin(0).Aside: these cases with
noneand conversions from polar to rectangular and back always have a sharp edge somewhere. Really tricky to pick the right trade-offs :)svgeesus commentedon Sep 30, 2026
Okay so
oklch(60% 0.2 none)becomesoklab(60% 0.2 0)with all the chroma shoved into theaaxis, giving a deep magenta.Which then round-trips to
oklch(60% 0.2 0), preserving the chroma value it had before.So very true.
[css-color-4] Removed "If H is missing, a = b = 0" from LCH and Oklch…