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 toBase() and fromBase() automatically generated.

    Parameters

    Returns RGBColorSpace

Properties

aliases: string[]
base: Space
coords: Record<string, CoordMeta>
formats: Record<string, Format | FormatObject>
fromBase: ((coords: Coords) => Coords)
gamutSpace: Space
id: string
name: string
referred: string
toBase: ((coords: Coords) => Coords)
white: White
DEFAULT_FORMAT: {
    name: string;
    type: string;
} = ...
registry: Record<string, Space> = ...

Accessors

  • get cssId(): string
  • Returns string

  • get isPolar(): boolean
  • Returns boolean

  • get isUnbounded(): boolean
  • Returns boolean

Methods

  • Check if this color space is the same as another color space reference. Allows proxying color space objects and comparing color spaces with ids.

    Parameters

    • space: string | Space

      ColorSpace object or id to compare to

    Returns boolean

  • Lookup a format in this color space

    Parameters

    • format: string | Format | FormatObject

      Format id if string. If object, it's converted to a Format object and returned.

    Returns Format

  • Parameters

    • coords: Coords
    • __namedParameters: {
          epsilon: number;
      } = {}
      • epsilon: number

    Returns boolean

  • Look up all color spaces for a format that matches certain criteria

    Parameters

    • filters: any
    • Optionalspaces: Space[] = ColorSpace.all

    Returns Format

  • Lookup ColorSpace object by name

    Parameters

    • space: string | Space
    • Rest...alternatives: (string | Space)[]

    Returns Space

    If no matching color space is found

  • Get metadata about a coordinate of a color space

    Parameters

    • ref: Ref
    • OptionalworkingSpace: string | Space

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

    If no space or an unknown space is provided