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

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

inputProps
requis
Record<string, unknown>
Base props spread onto every channel input element for this mode (e.g. min/max/step for number inputs).
inputs
requis
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
requis
(color: any) => THSVA
Convert a colour from this mode's native representation (e.g. an RGBA object) to the internal THSVA tuple.
to
requis
(color: THSVA) => any
Convert the internal THSVA tuple back to this mode's native representation for output and display.

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Shape of a custom colour mode descriptor

typescript