Skip to content

[css-color-4] Gamut Mapping Clarifications #9651

@jamesnw

Description

@jamesnw

In implementing the Gamut Mapping Algorithm in Color.js, I found a few areas where clarification in the pseudocode could be helpful. If any of these are too pedantic for pseudocode, feel free to ignore.

  1. In step 1, replace return |origin| with convert |origin| to |destination| and return it as the gamut mapped color. The explicit conversion is the important bit, the "as the gamut mapped color" is for parity with the other returns.
  2. In step 10, defining clip, should we change it to specify it clamps to the range of the color channel, instead of 0-1? This may be a moot point, as it appears that only unbounded spaces which don't go through this portion have channel ranges besides 0-1.
  3. In steps 3 and 4, where we return white/black, should we specify white/black instead of 1's and 0's? Like # 2, this may be a moot point, as only unbounded spaces appear to have other channel values for white/black.
  4. Nit: In step 10, defining clip, there's an extra pipe character at the end of clip(color)|

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