Skip to content

[css-color-4] Drop If H is missing, a = b = 0 in 9.6? #14530

Description

@romainmenke

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions