Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the component. |
properties |
Object
|
HTMLElement
|
The properties used to initialize the component or the container element. |
- Mixes In:
Returns:
An instance of the component.
-
Type
-
Object
Extends
Classes
- ColorButtonEvents
Members
Gets or sets the clientid of the button.
Type:
colorPickerId :String|null
Gets or sets the id of the corresponding colorpicker.
Type:
cssClassColorBox :String
Gets or sets the css class of the color box.
Type:
Type:
hex :String
Gets or sets the color in the hexadecimal format.
Type:
Gets or sets the id of the hidden input from which the settings are cloned.
Type:
hsba :String|null
Gets or sets the color in the format Hue, Saturation, Brightness, Alpha.
Type:
rgba :String|null
Gets or sets the color in the format Red, Green, Blue, Alpha.
Type:
value :String
Gets or sets the color in either hexadecimal or RGBA format.
Type:
Methods
Returns the underlying Button component instance.
Returns:
-
Type
-
componyx.UI.Button
getHex()
Returns the current selected hex color value.
getRGBA() → {Array.<Number>}
Gets the RGBA color value
Returns:
The RGBA color value as array of numbers.
-
Type
-
Array.<Number>
getValue() → {String}
Gets the RGBA color value.
Returns:
The RGBA string value as in 'r,g,b,a' or '' if no color was set.
-
Type
-
String
postRender()
Handles the post render procedure.
render()
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 |
Default |
Description |
r |
String
|
|
Red value (0-255). |
g |
String
|
|
Green value (0-255). |
b |
String
|
|
Blue value (0-255). |
a |
String
|
1
|
Alpha value (0-1). |
setValue(rgbaValue)
Sets the RGBA color value.
Parameters:
| Name |
Type |
Description |
rgbaValue |
String
|
The RGBA string value as in 'r,g,b,a' |
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:
Type Definitions
ConfirmEventArgs
ColorButton confirm event arguments.
Type:
Properties:
| Name |
Type |
Description |
rgba |
Array.<Number>
|
The confirmed RGBA color value as [r, g, b, a]. |