Class GSColorPicker
A color picker control.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSColorPicker(parent, options)
Creates a new
GSColorPicker |
| Property Attributes | Property Name and Description |
|---|---|
|
The visibility of the picker
|
| Method Attributes | Method Name and Description |
|---|---|
|
hide()
Hides the color picker
|
|
|
hsv2Rgb(hsv)
Converts the HSV color to RGB
|
|
|
rgb2Hex(rgb)
Converts the RGB color to hex
|
|
|
rgb2Hsv(rgb)
Converts the RGB color to HSV
|
|
|
setColor(color)
Sets the color picker color
|
|
|
setVisible(visible)
Sets the visibilty of the color picker
|
|
|
show()
Shows the color picker
|
Class Detail
GSColorPicker(parent, options)
Creates a new
GSColorPicker
- Parameters:
- {HTMLElement} parent
- the color picker parent element
- {Object} options Optional
- an object literal specifying the color picker options to set:
- {int} options.x
- the x coordinate (in pixels) to position the color picker at
- {int} options.y
- the y coordinate (in pixels) to position the color picker at
- {String} options.color
- the initial color value for the color picker
- {boolean} options.visible
- the initial visibility of the color picker
- {Function} options.onChange
- callback function executed when color picker value changes
Property Detail
{boolean}
visible
The visibility of the picker
Method Detail
hide()
Hides the color picker
{Object}
hsv2Rgb(hsv)
Converts the HSV color to RGB
- Parameters:
- {Object} hsv
- the HSV color
- Returns:
- {Object} the RGB color
{String}
rgb2Hex(rgb)
Converts the RGB color to hex
- Parameters:
- {Object} rgb
- the RGB color
- Returns:
- {String} the hex color
{Object}
rgb2Hsv(rgb)
Converts the RGB color to HSV
- Parameters:
- {Object} rgb
- the RGB color
- Returns:
- {Object} the HSV color
setColor(color)
Sets the color picker color
- Parameters:
- {String} color
- a hex color value
setVisible(visible)
Sets the visibilty of the color picker
- Parameters:
- {boolean} visible
trueif the color picker should be visible
show()
Shows the color picker