Skip to main content

ColorPickerInitOptions

Index

Properties

optionalcolorState

colorState?: { colors: string[]; defaultColors?: readonly string[]; defaultOpacity?: readonly number[]; editOpacity: boolean; opacity: number[] }

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


Type declaration

  • colors: string[]

    The colors of the item

  • optionaldefaultColors?: readonly string[]

    The underlying assets default colors.

    @see
  • optionaldefaultOpacity?: readonly number[]

    The underlying assets default opacity.

    @see

    AssetLayer.Opacity of the asset's layers

  • editOpacity: boolean

    Whether the opacity is user-configurable

  • opacity: number[]

    The opacity of the item

optionaldisabled

disabled?: boolean

Whether the color picker should be disabled or not

optionaldispatch

dispatch?: boolean

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 | opacity | output | 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 | opacity | output | tint }>): any
    • Parameters

      • elem: HTMLFieldSetElement
      • ev: CustomEvent<{ source: hue | opacity | output | 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