See: https://drafts.csswg.org/css-color-4/#lch-to-lab
If H is missing, a = b = 0
I didn't implement this step and it seems that neither did colorjs, nor chrome
This was called out by @weinig in web-platform-tests/interop#1494
This seems inconsistent with hsl to srgb conversion where the result is a chromatic color.
rgb(from hsl(none 50 50) r g b)
becomes:
color(srgb 0.75 0.25 0.25)
It also means that the value doesn't round trip as nicely if you convert it back and forth between color spaces.
This also makes some interpolation impossible.
For example:
color-mix(in oklch, lch(80 30 270), lch(30 30 none))
Here an author might reasonably expect to have saturation that is consistent with 30 in lch.
e.g. oklch(0.61909628 0.08689075 264.1562336)
While instead it will be half that: oklch(0.61410188 0.04104694 264.1562336)
@svgeesus thoughts?
See: https://drafts.csswg.org/css-color-4/#lch-to-lab
I didn't implement this step and it seems that neither did colorjs, nor chrome
This was called out by @weinig in web-platform-tests/interop#1494
This seems inconsistent with
hsltosrgbconversion where the result is a chromatic color.becomes:
It also means that the value doesn't round trip as nicely if you convert it back and forth between color spaces.
This also makes some interpolation impossible.
For example:
Here an author might reasonably expect to have saturation that is consistent with
30in lch.e.g.
oklch(0.61909628 0.08689075 264.1562336)While instead it will be half that:
oklch(0.61410188 0.04104694 264.1562336)@svgeesus thoughts?