Skip to content

@jsvision/ui / ColorPickerOptions

Interface: ColorPickerOptions

Defined in: ui/src/color/color-picker.ts:155

Options for a ColorPicker.

Properties

allowCustom?

optional allowCustom?: boolean

Defined in: ui/src/color/color-picker.ts:163

Include a hex Input in the popup for arbitrary #rrggbb truecolor (default true).


colors?

optional colors?: readonly Color[]

Defined in: ui/src/color/color-picker.ts:159

Palette forwarded to the ColorSwatch (default ANSI16_ORDER).


columns?

optional columns?: number

Defined in: ui/src/color/color-picker.ts:161

Columns forwarded to the ColorSwatch (default 4).


label?

optional label?: string

Defined in: ui/src/color/color-picker.ts:165

Optional chip caption prefix (used when nameFor is absent).


nameFor?

optional nameFor?: (c) => string

Defined in: ui/src/color/color-picker.ts:167

Optional name accessor for the chip caption.

Parameters

c

Color

Returns

string


onChange?

optional onChange?: (c) => void

Defined in: ui/src/color/color-picker.ts:171

Fired on the discrete commit gesture (Enter / Space / mouse-up), which also closes the popup.

Parameters

c

Color

Returns

void


onInput?

optional onInput?: (c) => void

Defined in: ui/src/color/color-picker.ts:169

Fired on every live value change in the popup (arrow / click / drag).

Parameters

c

Color

Returns

void


value

value: Signal<Color>

Defined in: ui/src/color/color-picker.ts:157

Two-way selected color (shared with the hosted swatch + hex field).