new ColorPicker()
Pure JavaScript color picker.
- Source:
- See:
Members
(readonly) paletteIndexes :number
enumeration of available palettes.
Type:
- number
Properties:
Name | Type | Description |
---|---|---|
BGYW |
number | blue, green, yellow, white palette. This is the default palette |
monochrome |
number | monochrome palette |
bidirectional |
number | red, black, green palette |
rainbow |
number | rainbow palette |
- Source:
Methods
create(elSliderWrapper, optionsopt)
creates an instance of ColorPicker
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elSliderWrapper |
string | HTMLElement | id of the ColorPicker element or ColorPicker element | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
object |
<optional> |
followed options is availablee
Properties
|
- Source:
getPalette() → {Array.<object>}
- Source:
Returns:
palette array
- Type
- Array.<object>
getPaletteIndex()
- Source:
Returns:
Index of palette.
0 - BGYW 1 - monochrome 2 - bidirectional 3 - rainbow
hsv2rgb(stringPercent, minopt, maxopt) → {object}
converts a percent or value from min to max to object with r, g, b, hex and percent.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stringPercent |
number | coordinate of color from palette in percent or value from min to max | |
min |
number |
<optional> |
min stringPercent. |
max |
number |
<optional> |
max stringPercent. |
- Source:
Returns:
object with r, g, b, hex and percent
- Type
- object
isPalette()
- Source:
Returns:
true
palette(optionsopt)
create palette
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
the following options are available
Properties
|
- Source:
toColor(value, minopt, maxopt) → {THREE.Color}
converts a value in percentages to color.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
number | coordinate of color from palette in percent. Default value range from 0 to 100. | |
min |
number |
<optional> |
minimal value |
max |
number |
<optional> |
maximal value |
- Source:
Returns:
- Type
- THREE.Color