Skip to content

charton API


charton API / @chart-on/ui / index / ColorControlOptions

Interface: ColorControlOptions ​

Defined in: ui/src/color-control.ts:50

Options for createColorControl: its accessible name, the starting color, swatches, and the live-change and commit callbacks.

Properties ​

label ​

label: string

Defined in: ui/src/color-control.ts:52

Accessible name, e.g. "Rising candle body".


localization? ​

optional localization?: Localizer

Defined in: ui/src/color-control.ts:60

The language of the picker's own text, usually chart.localization. Default English.


swatches? ​

optional swatches?: readonly string[]

Defined in: ui/src/color-control.ts:58


value ​

value: string

Defined in: ui/src/color-control.ts:53

Methods ​

onCommit()? ​

optional onCommit(color): void

Defined in: ui/src/color-control.ts:57

Called once when the picker closes after a change, e.g. to record one undo step.

Parameters ​

color ​

string

Returns ​

void


onInput() ​

onInput(color): void

Defined in: ui/src/color-control.ts:55

Called on every change while the user picks, for a live preview.

Parameters ​

color ​

string

Returns ​

void