new ColorPicker( name, note, value, onChange [, options ] )

Description

Creates a color picker using Discord's built in color picker as a base. Input and output using hex strings.

Parameters
Name Type Attributes Description
name string

name label of the setting

note string

help/note to show underneath or above the setting

value string

current hex color

onChange callable

callback to perform on setting change, callback receives hex string

options object <optional>

object of options to give to the setting

Name Type Attributes Default Description
disabled boolean <optional>
false

should the setting be disabled

defaultColor string <optional>

default color to show as large option

colors Array.<number> <optional>

preset colors to show in swatch

Members


<static> presetColors

Description

Default colors for ColorPicker

Methods


getElement() → {HTMLElement}

Returns
  • root element for setting

onChange()

Description

Fires onchange to listeners


onAdded()

Description

Fired when root node added to DOM


onRemoved()

Description

Fired when root node removed from DOM