Skip to main content

ColorPickerInitOptions

Index

Properties

optionalcolorState

colorState?: Pick<ItemColorStateType, opacity | colors | editOpacity>

A custom color state. Defaults to ItemColorState if not provided.

optionaldisabled

disabled?: boolean

Whether the color picker should be disabled or not

optionalheading

heading?: string | Element | readonly (string | Element)[]

A custom heading to-be assigned to the color picker's <h1> element

optionalonExit

A callback to-be executed upon closing the color picker.

optionalonInput

onInput?: (elem: HTMLFieldSetElement, ev: CustomEvent<{ source: hue | output | opacity | tint }>) => any

A custom input event listener that will to be triggered by any valid input changes of the underlying interactive elements (hue slider, opacity slider, tint slider or output text).


Type declaration

    • (elem: HTMLFieldSetElement, ev: CustomEvent<{ source: hue | output | opacity | tint }>): any
    • Parameters

      • elem: HTMLFieldSetElement
      • ev: CustomEvent<{ source: hue | output | opacity | tint }>

      Returns any

optionalreset

reset?: boolean = ```ts false ```

Whether omitting an option will keep its currently configured state or reset it to its default whenever an explicit option is absent

optionalroot

The root element or color-picker fieldset (or ID thereof) in the color picker subscreen; defaults to ColorPicker.ids.root

optionalshape

shape?: readonly [number, number, number, number]

The dimensions of the color picker screen