Skip to content

[css-color-5] Colors where all channels (except) alpha have a value of none #10203

Open
@romainmenke

Description

@romainmenke

#10151 (comment)

@LeaVerou said in the context of preserving none in color space conversion:

If all components in the source color (except alpha) are none, then they remain none. (oklch(none none none / 0%) is like transparent on steroids)


I like this, I think it is useful.
It allows authors to get the full color of one side of an interpolation without knowing anything about that color.

Example:

.foo {
  color: color-mix(in oklab, var(--color-a), pink);
}


.bar {
  --color-a: rgb(none none none);
}

The author might not know what the other color or interpolation space is.
Setting a color with all channels to none creates a reliable way to get that pink.

I can even imagine a keyword for this: opaque which has a value of rgb(none none none / 100%)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions