A color palette is a grid of color swatches that the user can highlight or select via the keyboard or the mouse. The selection state of the palette is controlled by a selection model. When the user makes a selection, the component fires an ACTION event. Event listeners may retrieve the selected color using the {@link #getSelectedColor} method.
extends goog.ui.PaletteInstance Method Summary | |
createColorNodes_() ⇒ ?Array | |
getColors() ⇒ ?Array Returns the array of colors represented in the color palette. | |
getSelectedColor() ⇒ ?string | |
setColors(?Array colors) Sets the colors that are contained in the palette. | |
setSelectedColor(?string color) Sets the selected color. Clears the selection if the argument is null or can't be parsed as a color. |
Static Method Summary | |
parseColor_(?string color) ⇒ ?string Takes a string, attempts to parse it as a color spec, and returns a normalized hex color spec if successful (null otherwise). |