@OPEN-KAPPA/COLORS
    Preparing search index...

    Class ICtCp

    ICtCp (Intensity, Chroma Tritan, Chroma Protan). Standard: ITU-R BT.2100. A perceptual color space for High Dynamic Range (HDR) and Wide Color Gamut (WCG).

    • I (Intensity): 0.0 - 1.0 (Non-linear PQ). 1.0 represents 10,000 nits. ~0.51 represents 100 nits (SDR White). ~0.58 represents 203 nits (Diffuse White).
    • Ct (Blue-Yellow): -0.5 to +0.5 approx.
    • Cp (Red-Green): -0.5 to +0.5 approx.

    Pipeline: XYZ -> Rec.2020 Linear -> LMS Linear -> PQ Encoded -> ICtCp.

    Hierarchy (View Summary)

    Index

    Properties

    _alpha: number

    The alpha channel. Common to all color spaces.

    Pointer to concrete color spaces meta-information.

    META: ColorMeta<ICtCp> = ...

    The meta instance.

    Accessors

    • get alpha(): number

      Get the alpha channel.

      Returns number

      The value.

    • get chromaIndex(): number | null

      Get the color chroma index. Return null if the color has no chroma component.

      Returns number | null

      The component index.

    • get colorSpace(): (keyof PolarColorSpaces) | (keyof CartesianColorSpaces)

      Get the color space name.

      Returns (keyof PolarColorSpaces) | (keyof CartesianColorSpaces)

      The color space name.

    • get components(): number[]

      Get the color components as an array of values. The last element is always the alpha channel. The other components follow the color space name, e.g. RGB: [R, G, B, alpha].

      Returns number[]

      The component values.

    • get hueIndex(): number | null

      Get the color hue index. Return null if the color has no hue component (i.e. it is not cylindrical).

      Returns number | null

      The component index.

    • get lightnessIndex(): number | null

      Get the color lightness index. Return null if the color has no lightness component.

      Returns number | null

      The component index.

    • get _acromaticEpsilon(): number

      Get the tollerance value for achromatic check.

      Returns number

    • get gray(): ICtCp

      The base gray color in this color space. Corresponds to sRGB Gray (128, 128, 128). Approx 21.4 nits -> PQ ~0.35.

      Returns ICtCp

      The gray color.

    • get middleGray(): ICtCp

      The base perceptual gray color in this color space. Perceptual Middle Gray (18% reflectance of 100 nits). Approx 18 nits -> PQ ~0.34.

      Returns ICtCp

      The gray color.

    • get peakWhite(): ICtCp

      The Peak HDR white color (10,000 nits). Represents the maximum signal capacity of the PQ curve (1.0). Use this if you specifically want to target HDR highlights.

      Returns ICtCp

      The HDR white.

    • get white(): ICtCp

      The base white color in this color space. Represents Diffuse White (100 nits). Maps to PQ value approx 0.51. This ensures compatibility with algorithms like 'lighten' or 'balance'.

      Returns ICtCp

      The white color.

    Methods

    • Get the component value by index.

      Parameters

      • index: number

        The index.

      Returns number

      The component.

      If the index is invalid.

    • Get the component value by name.

      Parameters

      • name: string

        The name.

      Returns number

      The component.

      If the name is invalid.

    • Check whether the color is in a specific color space.

      Type Parameters

      • N extends (keyof PolarColorSpaces) | (keyof CartesianColorSpaces)

      Parameters

      • name: N

        The color space name.

      Returns this is ColorSpaceNames[N]

      True if this is in the color space.

    • Check whether the color respects its color space boundaries for HDR.

      Returns boolean

      The check result.

    • Check whether the color respects its color space boundaries for SDR.

      Returns boolean

      The check result.

    • Set the alpha component.

      Parameters

      • v: number

        The new value.

      Returns this

      The new instance with the alpha changed.

    • Set the component by index.

      Parameters

      • index: number

        The component index.

      • value: number

        The new value.

      Returns this

      The new instance with the component changed.

      If the index is invalid.

    • Set the component by name.

      Parameters

      • name: string

        The component name.

      • value: number

        The new value.

      Returns this

      The new instance with the component changed.

      If the name is invlaid.

    • Set the component vlaues. The last one is always the alpha channel. The other components follow the color space name, e.g. RGB: [R, G, B, alpha].

      Parameters

      • values: number[]

        The values to set.

      Returns this

      A new instance of the target color space.

    • Converts this color to any other color space.

      Type Parameters

      Parameters

      • targetSpace: ColorConstructor<T>

        The class constructor of the target space (e.g., Rgb, Oklch).

      Returns T

      A new instance of the target color space.

      const oklch = myRgb.to(Oklch);
      
    • Converts this color to the color space of the other color.

      Type Parameters

      Parameters

      • color: T

        The color of which match the color space.

      Returns T

      A new instance of the target color space.

    • Get the chroma component value. Return null if the color has no chroma component.

      Returns number | null

      The chroma value.

    • Get the hue component value. Return null if the color has no hue component.

      Returns number | null

      The hue value.

    • Get the lightness component value. Return null if the color has no lightness component.

      Returns number | null

      The lightness value.

    • Set the chroma component value. If null is passed, nothing is done.

      Parameters

      • c: number | null

        The new chroma value.

      Returns this

      A new instance of the target color space.

    • Set the hue component value. If null is passed, nothing is done.

      Parameters

      • h: number | null

        The new hue value.

      Returns this

      A new instance of the target color space.

    • Set the lightness component value. If null is passed, nothing is done.

      Parameters

      • l: number | null

        The new lightness value.

      Returns this

      A new instance of the target color space.

    • Check whether two colors are equals. If they are of different color spaces, they are considered different.

      Type Parameters

      Parameters

      • c1: C

        The first color.

      • c2: C

        The second color.

      • Optionalepsilon: number

      Returns boolean

      True of they are equals.

    • Create an instance from its components.

      Parameters

      • comps: number[]

        The components.

      Returns ICtCp

      The new instance.

      If the components length is invalid.

    • Convert XYZ components to this color space components.

      Parameters

      • xyzComps: number[]

        The XYZ components as [x, y, z, alpha].

      Returns number[]

      The color space components as [i, ct, cp, alpha].

    • Convert this color space components to XYZ components.

      Parameters

      • comps: number[]

        The color space components as [i, ct, cp, alpha].

      Returns number[]

      The XYZ components as [x, y, z, alpha].