Home

# Class goog.ui.ColorMenuButton

A color menu button control. Extends {@link goog.ui.MenuButton} by adding an API for getting and setting the currently selected color from a menu of color palettes.

extends goog.ui.MenuButton

Instance Method Summary
| `getSelectedColor() ⇒ ?string` Returns the currently selected color (null if none).
| `handleMenuAction(?goog.events.Event e)` Handles {@link goog.ui.Component.EventType.ACTION} events dispatched by the menu item clicked by the user. Updates the button, calls the superclass implementation to hide the menu, stops the propagation of the event, and dispatches an ACTION event on behalf of the button itself. Overrides {@link goog.ui.MenuButton#handleMenuAction}.
| `setOpen(boolean open)` Opens or closes the menu. Overrides {@link goog.ui.MenuButton#setOpen} by generating a default color menu on the fly if needed.
| `setSelectedColor(?string color)` Sets the selected color, or clears the selected color if the argument is null or not any of the available color choices.
| `setValue(?string color)` Sets the value associated with the color menu button. Overrides {@link goog.ui.Button#setValue} by interpreting the value as a color spec string.

Static Method Summary
| `newColorMenu(?Array= opt_extraItems, ?goog.dom.DomHelper= opt_domHelper) ⇒ ?goog.ui.Menu` Factory method that creates and returns a new {@link goog.ui.Menu} instance containing default color palettes.