Skip to content

ColorComponent

Defined in: obsidian.d.ts:682

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

Extends

Constructors

new ColorComponent()

new ColorComponent(containerEl): ColorComponent

Defined in: obsidian.d.ts:687

Parameters

containerEl

HTMLElement

Returns

ColorComponent

Overrides

ValueComponent.constructor

Properties

changeCallback()?

optional changeCallback: (value) => void

Defined in: src/obsidian/augmentations/Components/ColorComponent.d.ts:9

The function that’s called after changing the value of the component.

Parameters

value

string

Returns

void

colorPickerEl

colorPickerEl: HTMLInputElement

Defined in: src/obsidian/augmentations/Components/ColorComponent.d.ts:13

Access the underlying input element of type “color”


disabled

disabled: boolean

Defined in: obsidian.d.ts:423

Inherited from

ValueComponent.disabled

Methods

getValue()

getValue(): string

Defined in: obsidian.d.ts:695

Returns

string

Overrides

ValueComponent.getValue


getValueHsl()

getValueHsl(): HSL

Defined in: obsidian.d.ts:703

Returns

HSL


getValueInt()

getValueInt(): number

Defined in: src/obsidian/augmentations/Components/ColorComponent.d.ts:15

Returns

number


getValueRgb()

getValueRgb(): RGB

Defined in: obsidian.d.ts:699

Returns

RGB


onChange()

onChange(callback): this

Defined in: obsidian.d.ts:721

Parameters

callback

(value) => any

Returns

this


registerOptionListener()

registerOptionListener(listeners, key): this

Defined in: obsidian.d.ts:4219

Parameters

listeners

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

key

string

Returns

this

Inherited from

ValueComponent.registerOptionListener


setDisabled()

setDisabled(disabled): this

Defined in: obsidian.d.ts:691

Parameters

disabled

boolean

Returns

this

Overrides

ValueComponent.setDisabled


setValue()

setValue(value): this

Defined in: obsidian.d.ts:708

Parameters

value

string

Returns

this

Overrides

ValueComponent.setValue


setValueHsl()

setValueHsl(hsl): this

Defined in: obsidian.d.ts:716

Parameters

hsl

HSL

Returns

this


setValueInt()

setValueInt(value): this

Defined in: src/obsidian/augmentations/Components/ColorComponent.d.ts:16

Parameters

value

number

Returns

this


setValueRgb()

setValueRgb(rgb): this

Defined in: obsidian.d.ts:712

Parameters

rgb

RGB

Returns

this


then()

then(cb): this

Defined in: obsidian.d.ts:428

Facilitates chaining

Parameters

cb

(component) => any

Returns

this

Inherited from

ValueComponent.then