Home

# Class goog.ui.HsvPalette

Creates an HSV palette. Allows a user to select the hue, saturation and value/brightness.

extends goog.ui.Component

Instance Method Summary
| `canDecorate(?Element element) ⇒ boolean` HsvPalettes cannot be used to decorate pre-existing html, since the structure they build is fairly complicated.
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `enterDocument()` Renders the color picker inside the provided element. This will override the current content of the element.
| `getAlpha() ⇒ number` Alpha transparency of the currently selected color, in [0, 1]. For the HSV palette this always returns 1. The HSVA palette overrides this method.
| `getColor() ⇒ string` Gets the color that is currently selected in this color picker.
| `handleInput_(?goog.events.Event e)` Handles input events on the hex value input field.
| `handleMouseDown_(?goog.events.BrowserEvent e)` Handles mousedown events on palette UI elements.
| `handleMouseMoveHs_(?goog.math.Rect b, ?goog.events.BrowserEvent e)` Handles mousemove events on the document once a drag operation on the hue/saturation slider has started.
| `handleMouseMoveV_(?goog.math.Rect b, ?goog.events.BrowserEvent e)` Handles mousemove events on the document once a drag operation on the value slider has started.
| `handleMouseUp_(?goog.events.Event e)` Handles mouseup events on the document, which ends a drag operation.
| `setColor(string color)` Sets which color is selected and update the UI.
| `setColor_(string color)` Sets which color is selected.
| `setHsv(?number= opt_hue, ?number= opt_saturation, ?number= opt_value)` Alters the hue, saturation, and/or value of the currently selected color and updates the UI.
| `setHsv_(?number= opt_hue, ?number= opt_saturation, ?number= opt_value)` Alters the hue, saturation, and/or value of the currently selected color.
| `updateInput()` Updates the text entry field.
| `updateUi_()` Updates the position, opacity, and styles for the UI representation of the palette.