Skip to content

[css-color-4] Expand the concept of analogous components to analogous sets of components to minimize none0 conversions #10210

Open
@LeaVerou

Description

@LeaVerou

(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 become none.

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 to 0.

To that goal, I can see a few improvements we can make to minimize none0 conversions even more:

  1. Instead of analogous components, word the prose around analogous sets of components. The current analogous components are just sets of size 1.
  2. If two color spaces have analogous components, the components remaining after you remove all analogous components, are an analogous set. Meaning, if Lab L is analogous to OKLch L, this means Lab a,b are analogous to OKLCh c, h., so converting e.g. oklch(50% none none) to lab yields lab(42 none none).
  3. The set of all components is analogous in every color space (basically [css-color-5] Colors where all channels (except) alpha have a value of none #10203 )

Not sure if this can be considered editorial, or we'd need WG resolution. @svgeesus ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions