Skip to content

[css-color-5] Should intermediate out of range values be preserved in color-mix? #10414

Open
@cdoublev

Description

@cdoublev

Preserving intermediate out of range values in relative colors is explicitly required since this commit following this comment:

[...] the whole reason we added the serialization of RCS rgb(), hsl() and hwb() to color(srgb) specifically to enable round-tripping of out of gamut values. [...] CSS Color 5 needs to specifically say that RCS versions of those color functions do not clamp out of range values.

color-mix() must also serialize with color(srgb ...) instead of rgb(). Is it also intended to preserve intermediate out of range values?

For example, what should be the resolved value of color-mix(in srgb, rgb(270 0 0), rgb(270 0 0))?

  1. color(srgb 1 0 0)
  2. color(srgb 1.058823 0 0)

1 is the current output in Chrome and FF (at least) and is equivalent to color-mix(in srgb, rgb(255 0 0), rgb(255 0 0)), ie. intermediate out of range values are clamped.

2 is derived from the output of new Color('rgb(270 0 0)').coords with the color-js library (which serializes as rgb(255 33.838 23.697) though).

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