Interface ColorModel

The color model defines transformation from and to RGBa color model.

interface ColorModel {
    componentCount: number;
    name: string;
    convertComponentsToRGB(components: readonly number[], rgb: RGB): void;
    convertRGBToComponents(rgb: readonly [number, number, number, number], components: number[]): void;
}

Properties

componentCount: number

The number of color components that the model uses.

name: string

The name of the color model.

Methods

  • Converts color components to RGBa color model.

    Parameters

    • components: readonly number[]

      The color components.

    • rgb: RGB

      The RGBa color components to update.

    Returns void

  • Converts color components from RGBa color model to this color model.

    Parameters

    • rgb: readonly [number, number, number, number]

      RGBa color components.

    • components: number[]

      The color components that must be updated.

    Returns void