Constructor
new ColorScalePicker(target, options)
options = {
maxItems: number (default: 5)
min: number (default: 0),
max: number (default: 1)
}
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement | |
options |
object |
- Source:
Methods
addColor(item)
Add a color item to the scale
Parameters:
Name | Type | Description |
---|---|---|
item |
object | color item |
- Source:
clearItems()
Remove all items from the ColorChooser
- Source:
deleteColor(index)
Delete a color item from the color scale
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of item |
- Source:
getColorScale()
Get the color scale as an array
- Source:
setColor(item, index)
Change config of an existing color item
Parameters:
Name | Type | Description |
---|---|---|
item |
object | new item config |
index |
number | index of item |
- Source:
setPresets(presets)
set presets to be selected by the user from a
dropdown list
Parameters:
Name | Type | Description |
---|---|---|
presets |
Array.<object> |
- Source:
setScale(scale)
Set the scale of the color chooser
based of an existing Array of color items
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | color scale array |
- Source: