A color picker with HEX and RBG support.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props | object | Component props. Properties
|
- Since
- 1.1.15
Returns:
The ColorPicker component.
- Type:
- object
Example
import ColorPicker from '@gravityforms/components/react/admin/modules/ColorPicker';
return ( <ColorPicker onSave={ () => { handleSave(); } } value="#000" /> );
Methods
(inner) handleClose() → {void}
Handle the hex color picker close event.
- Since
- 1.1.15
Returns:
- Type:
- void
(inner) handleOnChange(newValue) → {void}
Handler for the hex color picker change event.
Parameters:
Name | Type | Description |
---|---|---|
newValue | string | The new color value. |
- Since
- 1.1.15
Returns:
- Type:
- void
(inner) renderRGBInput(colorPart, index) → {JSX.Element}
Render the RGB input field.
Parameters:
Name | Type | Description |
---|---|---|
colorPart | string | The color value. |
index | number | The index of the color. |
- Since
- 1.1.15
Returns:
- Type:
- JSX.
Element