Enable or disable alpha support.
When disabled, it will strip the alpha value from the existing color value in all formats.
Whether to show an optional clear button. Use clearLabel
to set the label.
Note that this should be a boolean, a ClearButtonOptions
object is still
supported for backwards compatibility, but it is deprecated.
Set the label of the clear button.
Whether to show an optional close button. Use closeLabel
to set the label.
Note that this should be a boolean, a CloseButtonOptions
object is still
supported for backwards compatibility, but it is deprecated.
Set the label of the close button.
Focus the color value input when the color picker dialog is opened.
Set to true to always include the alpha value in the color value even if the opacity is 100%.
Sets the preferred color string format. The format affects which value is shown in the input field. See ColorFormat for more details.
Set to true to enable format toggle buttons in the color picker dialog.
This will also force the format to auto.
The margin in pixels between the input fields and the color picker's dialog.
A function that is called whenever a new color is picked.
CSS selector for the parent.
The default behavior is to append the color picker's dialog to the end of the document's body. but it is possible to append it to a custom parent instead. This is especially useful if the color fields are in a scrollable container and you want color picker' dialog to stay anchored to them. You will need to set the position of the container to relative or absolute. Note: This should be a scrollable container with enough space to display the picker.
Select and focus the color value input when the color picker dialog is opened.
An array of the desired color swatches to display. If omitted or the array is empty, the color swatches will be disabled.
Set to true to hide all the color picker widgets (spectrum, hue, ...) except the swatches.
The color theme to use for the color picker. More themes might be added in the future. Available themes: default, large, polaroid.
Set the theme to light or dark mode:
Generated using TypeDoc
Settings that can be configured for each color picker instance separately.
0.15.0