new ColorPicker()
- Mixes In:
Extends
Classes
- ColorPickerEvents
Members
boxId :String|null
Gets or sets the clientid of the popup box.
Type:
Gets or sets the id of the component from which the settings are cloned for the cancel button.
Type:
Gets or sets the text label of the cancel button.
Type:
Gets or sets the id of the component from which the settings are cloned for the clear button.
Type:
Gets or sets the text label of the clear button.
Type:
Gets or sets the id of the component from which the settings are cloned for the confirm button.
Type:
Gets or sets the text label of the confirm button.
Type:
cssClassAlpha :String
Gets or sets the css class of the alpha input container.
Type:
Gets or sets the css class appended to the cancel button.
Type:
Gets or sets the css class appended to the clear button.
Type:
Gets or sets the css class appended to the confirm button.
Type:
cssClassHSB :String
Gets or sets the css class of the hue-saturation-brightness(value) input container.
Type:
cssClassHex :String
Gets or sets the css class of the hex input container.
Type:
cssClassHue :String
Gets or sets the css class of the hue palette.
Type:
Gets or sets the css class of the input container.
Type:
cssClassPicker :String
Gets or sets the css class of the saturation and hue picker.
Type:
cssClassPreview :String
Gets or sets the css class of the preview color box.
Type:
cssClassRGB :String
Gets or sets the css class of the red-green-blue input container.
Type:
cssClassSaturation :String
Gets or sets the css class of the saturation palette.
Type:
Type:
hex :String
Gets or sets the color in the hexadecimal format.
Type:
hsba :String|null
Gets or sets the color in the format Hue, Saturation, Brightness, Alpha.
Type:
numericBoxId :String|null
Gets or sets the clientid of the numeric box.
Type:
Gets or sets a value indicating if the color picker is displayed within a popup with a color box as popup trigger.
Type:
rgba :String|null
Gets or sets the color in the format Red, Green, Blue, Alpha.
Type:
Methods
destroy()
- See:
-
expand(expanderopt, rgbaopt, confirmCallbackopt, boxPositionopt, modalopt, toggleopt)
Expands the colorpicker popup box.
Parameters:
| Name |
Type |
Attributes |
Description |
expander |
HTMLElement
|
String
|
<optional>
|
The expander element or id of the expander element. |
rgba |
Array.<String>
|
<optional>
|
RGBA color value. |
confirmCallback |
function
|
<optional>
|
The callback function to call when the color is confirmed through the confirm button. |
boxPosition |
componyx.UI.Box.AutoPositionOption
|
<optional>
|
The popup box autoPosition. |
modal |
Boolean
|
<optional>
|
A value indicating if the colorpicker popup is shown as modal. |
toggle |
Boolean
|
<optional>
|
A value indicating if the colorpicker popup hides when already showing. |
Gets the corresponding box component.
Returns:
-
Type
-
componyx.UI.Box
getHSBA()
Returns the current selected HSBA color value.
getHex()
Returns the current selected hex color value.
getRGBA()
Returns the current selected RGBA color value.
postRender()
Handles the post render procedure.
render()
setHSBA(h, s, b, a)
Sets the selected color to the specified HSBA color value.
Parameters:
| Name |
Type |
Description |
h |
Number
|
Hue value (0-1). |
s |
Number
|
Saturation value (0-1). |
b |
Number
|
Brightness value (0-1). |
a |
Number
|
Alpha value (0-1). |
setHex(value)
Sets the selected color to the specified hex color value.
Parameters:
| Name |
Type |
Description |
value |
String
|
Hex color value. |
setRGBA(r, g, b, a)
Sets the selected color to the specified RGBA color value.
Parameters:
| Name |
Type |
Description |
r |
Number
|
Red value (0-255). |
g |
Number
|
Green value (0-255). |
b |
Number
|
Blue value (0-255). |
a |
Number
|
Alpha value (0-1). |
suppressNextChangeEvent(action)
Suppresses any change events fired by the underlying input element during the execution of the provided action. Use this when programmatically setting a component value to prevent the change event from propagating as a user interaction.
The suppression is automatically lifted after the action completes, even if it throws.
Parameters:
| Name |
Type |
Description |
action |
function
|
The action to execute with change events suppressed. |
- Mixes In:
(static) hsvToRgb(h, s, v) → {Array.<Number>}
Converts the hsv value to rgb.
Parameters:
| Name |
Type |
Description |
h |
Number
|
The hue value 0-1. |
s |
Number
|
The saturation value 0-1. |
v |
Number
|
The lightness value 0-1. |
Returns:
-
Type
-
Array.<Number>
(static) rgbToHsv(r, g, b) → {Array.<Number>}
Converts the rgb value to hsv.
Parameters:
| Name |
Type |
Description |
r |
Number
|
The red value 0-255. |
g |
Number
|
The green value 0-255. |
b |
Number
|
The blue value 0-255. |
Returns:
The hue saturation value.
-
Type
-
Array.<Number>
Type Definitions
ColorPickerEventArgs
Type:
Properties:
| Name |
Type |
Description |
ColorPicker |
componyx.UI.ColorPicker
|
The ColorPicker instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
| Name |
Type |
Description |
rgba |
Array.<number>
|
The RGBA color value as [r, g, b, a]. |
|