Interface ToGamutOptions

interface ToGamutOptions {
    blackWhiteClamp?: {
        channel: Ref;
        max: number;
        min: number;
    };
    deltaEMethod?: "" | "76" | "Jz" | "HCT" | "CMC" | "2000" | "ITP" | "OK" | "OK2";
    jnd?: number;
    method?: "css" | "clip" | string & {};
    space?: string | Space;
}

Properties

blackWhiteClamp?: {
    channel: Ref;
    max: number;
    min: number;
}

Used to configure SDR black and clamping. channel indicates the space.channel to use for determining when to clamp. min indicates the lower limit for black clamping and max indicates the upper limit for white clamping

Type declaration

  • channel: Ref
  • max: number
  • min: number
deltaEMethod?: "" | "76" | "Jz" | "HCT" | "CMC" | "2000" | "ITP" | "OK" | "OK2"
jnd?: number

The "just noticeable difference" to target

method?: "css" | "clip" | string & {}

How to force into gamut.

If "clip", coordinates are just clipped to their reference range.
If "css", coordinates are reduced according to the CSS 4 Gamut Mapping Algorithm.
If in the form [colorSpaceId].[coordName], that coordinate is reduced until the color is in gamut. Please note that this may produce nonsensical results for certain coordinates (e.g. hue) or infinite loops if reducing the coordinate never brings the color in gamut

Default

"css"
space?: string | Space

The color whose space is being mapped to. Defaults to the current space