IColorPickerMode

interface
Color

Descriptor for a single colour input mode (RGB, HSL, HSV, HEX) — holds the input field config, bi-directional HSVA conversion functions and the list of editable channel inputs.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

inputProps
required
Record<string, unknown>
Base props spread onto every channel input element for this mode (e.g. min/max/step for number inputs).
inputs
required
Array<{ [key: string]: any label: string getValue: (color: any) => number | string getColor: (color: any, v: string) => any }>
List of editable channel inputs. Each entry has a display label, a getter to extract the channel value from a colour and a setter that merges a new channel value back into the colour.
from
required
(color: any) => THSVA
Convert a colour from this mode's native representation (e.g. an RGBA object) to the internal THSVA tuple.
to
required
(color: THSVA) => any
Convert the internal THSVA tuple back to this mode's native representation for output and display.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Shape of a custom colour mode descriptor

typescript