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

    Class ColorMeta<C>

    Class representing meta informations about a color space. Useful to generalize/factorize some manipulations and to push the tree-shaking.

    Type Parameters

    Index

    Accessors

    • get chromaIndex(): number | null

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

      Returns number | null

      The component index.

    • get componentNames(): readonly string[]

      Get the component names.

      Returns readonly string[]

      The component names.

    • get componentNumber(): number

      Get the number of components.

      Returns number

      The number of components.

    • get constraint(): ((comps: number[]) => number[]) | undefined

      Get the constraint function.

      Returns ((comps: number[]) => number[]) | undefined

      The constraint function.

    • get hueIndex(): number | null

      Get the 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 lightness index. Return null if the color has no lightness component.

      Returns number | null

      The component index.

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

      Get the color space name.

      Returns (keyof PolarColorSpaces) | (keyof CartesianColorSpaces)

      The color space name.

    • get xyyBoundaries(): Point2D[] | null

      Get the cohordinates of the polygon delimiting the color validity in xyY space.

      Returns Point2D[] | null

      The cohordinates.

    Methods

    • Get the component index by name. Returns null if no name matches.

      Parameters

      • name: string

        The component name.

      Returns number | null

      The index.

    • Get the component name by index. Returns null if no index matches.

      Parameters

      • index: number

        The component indxe.

      Returns string | null

      The index.

    • Check whether the component name is valid.

      Parameters

      • name: string

      Returns boolean

      True if valid.