Skip to content

[css-color-5] For color-mix(), what should happen if you provide an adjuster without a paired percent? #6046

@weinig

Description

@weinig

In CSS Color 5's color-mix() function, https://drafts.csswg.org/css-color-5/#color-mix, what should happen if an adjuster is specified without a percentage. For example:

color-mix(lch, red lightness, blue);

The grammar for color-adjuster allows this:

<color-adjuster> = [ [
      <srgb-adjuster> | <hsl-adjuster> | <hwb-adjuster>
    | <xyz-adjuster> | <lab-adjuster> | <lch-adjuster>
  ] | alpha ] <percentage>?

due to the "?" after , but I am unclear what the semantics are of that.

In my investigative implementation, I treat an adjuster without a percentage as equivalent to specifying 0% for that adjuster, so for the example above, it would be equivalent to:

color-mix(lch, red lightness 0%, blue);

but I am not convinced this is the intention of the spec authors.

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