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

    Class ColorCorrectionAbstract

    Class for functions regarding color corrections.

    Index

    Methods

    • Apply white adaptation. Map a color from a white point to a target white point.

      Type Parameters

      Parameters

      • color: C

        The color to manipulate.

      • srcWhite: C

        The color white point.

      • dstWhite: C

        The color target point

      • method: "bradford" | "cat02" | "vonKries" | "xyzScaling" = "bradford"

        The color adaptation method.

      Returns C

      The color with the white mapped.

    • Apply white adaptation. Map a color from a white point to a target white point.

      Type Parameters

      Parameters

      • color: number[]

        The color to manipulate.

      • srcWhite: C

        The color white point.

      • dstWhite: C

        The color target point

      • method: "bradford" | "cat02" | "vonKries" | "xyzScaling" = "bradford"

        The color adaptation method.

      Returns number[]

      The color with the white mapped.

    • Check if the color is inside the 2D chromaticity polygon (xy coordinates). Uses the Ray-Casting algorithm (Even-Odd Rule).

      Type Parameters

      Parameters

      • color: Xyy

        The xyY color to check.

      • meta: ColorMeta<C>

        The metadata of the reference space defining the boundaries.

      Returns boolean

      True if color is inside the gamut polygon (or if gamut is unbound).

    • Checks if the color is inside the 3D volume defined by the gamut primaries and luminance limits. NOTE: This checks a Cylinder volume. It does not account for the physical fact that max luminance decreases with saturation (the "Tent" shape).

      Type Parameters

      Parameters

      • color: Xyy

        The color to check.

      • meta: ColorMeta<C>

        The metadata of the reference space.

      Returns boolean

      True if color is inside the defined volume.

    • Maps the color to fit inside its own SDR gamut using Oklch chroma reduction.

      Type Parameters

      Parameters

      • color: C

        The color to map (e.g., a ProPhoto color).

      • OptionallimitAsHdr: boolean

        Whehter to consider HDR limits instead of SDR limits.

      Returns C

      The mapped color, fitted within the limits.

    • Map a color to a target color space, mapping also its white point. The steps are the following:

      1. Map color to XYZ.
      2. Apply white correction from original color space to destination color space.
      3. Map to destinaton color space.

      Type Parameters

      Parameters

      • color: Color

        The color to map.

      • space: ColorConstructor<C>

        The target color space.

      • Optionalmethod: "bradford" | "cat02" | "vonKries" | "xyzScaling"

        The color adaptation method.

      Returns C

    • Map a color to a target color space, mapping also its white point. The steps are the following:

      1. Map color to XYZ.
      2. Apply white correction from original color space to destination color space.
      3. Map to destinaton color space.

      Type Parameters

      Parameters

      • color: number[]

        The color to map.

      • colorSpace: ColorConstructor<C1>
      • space: ColorConstructor<C2>

        The target color space.

      • Optionalmethod: "bradford" | "cat02" | "vonKries" | "xyzScaling"

        The color adaptation method.

      Returns number[]