Interface ColorSpec<M, K>

interface ColorSpec<M, K> {
    channels?: Partial<Record<K, ChannelSpec>>;
    from: Partial<Record<ColorMode, ColorOp | Tuple<ColorOp, 2 | 3 | 4>>> & {
        rgb: ColorOp;
    };
    mode: M;
    order: readonly K[];
    toRgb: ColorOp | Tuple<ColorOp, 2 | 3 | 4>;
}

Type Parameters

Properties

channels?: Partial<Record<K, ChannelSpec>>

Define additional per-channel constraints, information. Currently only used to define limits.

from: Partial<Record<ColorMode, ColorOp | Tuple<ColorOp, 2 | 3 | 4>>> & {
    rgb: ColorOp;
}

Conversions from source modes. rgb is mandatory, others optional. If a key specifies an array of functions, these will be applied to source color in LTR order.

Type declaration

mode: M
order: readonly K[]

Channel names in index order (used to define channel accessors).

toRgb: ColorOp | Tuple<ColorOp, 2 | 3 | 4>

Mandatory conversion to RGB mode. Used as fallback solution if no other direct conversion path is defined (e.g. for CSS formatting).

Generated using TypeDoc