Skip to content

ColorComponent

Color picker component. Values are by default 6-digit hash-prefixed hex strings like #000000.

Extends

Constructors

new ColorComponent()

new ColorComponent(containerEl): ColorComponent

Parameters

containerEl: HTMLElement

Returns

ColorComponent

Overrides

ValueComponent.constructor

Properties

colorPickerEl

colorPickerEl: HTMLInputElement

Access the underlying input element of type “color”


disabled

disabled: boolean

Inherited from

ValueComponent.disabled

Methods

getValue()

getValue(): string

Returns

string

Overrides

ValueComponent.getValue


getValueHsl()

getValueHsl(): HSL

Returns

HSL


getValueInt()

getValueInt(): number

Returns

number


getValueRgb()

getValueRgb(): RGB

Returns

RGB


onChange()

onChange(callback): this

Parameters

callback

Returns

this


registerOptionListener()

registerOptionListener(listeners, key): this

Parameters

listeners: Record<string, (value?) => string>

key: string

Returns

this

Inherited from

ValueComponent.registerOptionListener


setDisabled()

setDisabled(disabled): this

Parameters

disabled: boolean

Returns

this

Overrides

ValueComponent.setDisabled


setValue()

setValue(value): this

Parameters

value: string

Returns

this

Overrides

ValueComponent.setValue


setValueHsl()

setValueHsl(hsl): this

Parameters

hsl: HSL

Returns

this


setValueInt()

setValueInt(value): this

Parameters

value: number

Returns

this


setValueRgb()

setValueRgb(rgb): this

Parameters

rgb: RGB

Returns

this


then()

then(cb): this

Facilitates chaining

Parameters

cb

Returns

this

Inherited from

ValueComponent.then