Convenience class for RGB color spaces

Hierarchy (view full)

Constructors

  • Creates a new RGB ColorSpace. If coords are not specified, they will use the default RGB coords. Instead of fromBase() and toBase() functions, you can specify to/from XYZ matrices and have the default toBase() and fromBase() methods use them via this.M.toXYZ and this.M.fromXYZ.

    Parameters

    Returns RGBColorSpace

Properties

aliases?: string[]
base: Space
bases: Space[]

This space's ancestors, ordered closest first (immediate base → root), excluding this space

coords: Record<string, CoordMeta>
displaySpaces?: Space[]

Spaces to try when serializing for display and this space is not natively supported

formats: Record<string, SpaceFormat>
gamutSpace: Space
id: string
linearGamut?: RGBColorSpace
M: Record<string, Matrix3x3>

Matrices relevant to this color space, keyed by a descriptive name

name: string
referred?: string
rgbGamut?: RGBColorSpace
white: White
DEFAULT_FORMAT: {
    name: "color";
    type: "functions";
}
registry: Record<string, Space>

Accessors

  • get cssId(): string
  • The ID used by CSS, such as display-p3 or --cam16-jmh

    Returns string

  • get isPolar(): boolean
  • Returns boolean

  • get isUnbounded(): boolean
  • Returns boolean

Methods

  • Parameters

    • coords: Coords
    • Optionaloptions: {
          epsilon?: number;
      }
      • Optionalepsilon?: number

    Returns boolean

  • Parameters

    • ref: Ref
    • OptionalworkingSpace: string | Space

    Returns CoordMeta & {
        id: string;
        index: number;
        space: Space;
    }

    If no space or an unknown space is provided