1. Domino UI
  2. Components
  3. Color picker
Top Basic Button Popover Docs

Color picker

A ColorPicker component that allows users to select colors in various formats.

It integrates multiple color selection tools including HSVPicker , HuePicker , and PickerFields for precise color adjustments.

The component provides event-driven change listeners and supports different color representations like RGB, HSL, HSV, and Hex.

Examples

Basic picker Full featured color picker supporting different color formats.

Picker button Use a button to open color picker

Color picker in a popover Open the color picker in a custom popover

API Docs: ColorPicker

Constructors

public void ColorPicker()
Constructs a new ColorPicker with default settings and UI components.

Static methods

public static ColorPicker create()
Creates a new instance of ColorPicker .

Returns:

A new ColorPicker instance.

Public methods

public ColorPicker addChangeListener(ChangeListener<? super Color> changeListener)
Adds a change listener to monitor color value changes.

changeListener

The listener to add.



Returns:

This ColorPicker instance.

public HTMLDivElement element()
Retrieves the root HTML element of the color picker.

Returns:

The HTML element representing the color picker.

public Set<ChangeListener<? super Color>> getChangeListeners()
Retrieves an unmodifiable set of registered change listeners.

Returns:

The set of change listeners.

public Color getValue()
Retrieves the current color value.

Returns:

The current color.

public void setValue(Color value)
Sets a new color value.

value

The new color value to set.

public boolean hasChangeListener(ChangeListener<? super Color> changeListener)
Checks if a specific change listener is registered.

changeListener

The listener to check.



Returns:

true if the listener is registered, otherwise false .

public boolean isChangeListenersPaused()
Checks if change listeners are currently paused.

Returns:

true if listeners are paused, otherwise false .

public boolean isFieldsVisible()
Checks if the fields panel is visible.

Returns:

true if fields are visible, otherwise false .

public ColorPicker setFieldsVisible(boolean fieldsVisible)
Sets the visibility of the fields panel.

fieldsVisible

true to show fields, false to hide them.



Returns:

This ColorPicker instance.

public ColorPicker pauseChangeListeners()
Check super implementation documentation.

ColorPicker-specific behavior: Pausing listeners will suppress change events while allowing internal component updates.

Returns:

This ColorPicker instance for chaining

public ColorPicker resumeChangeListeners()
Check super implementation documentation.

Resumes firing change events if they were paused. Any changes made while paused will trigger a single composite change event.

Returns:

This ColorPicker instance for chaining

public ColorPicker togglePauseChangeListeners(boolean toggle)
Check super implementation documentation.

toggle

true to pause listeners, false to resume



Returns:

This ColorPicker instance for chaining

We are a group of passionate people who love what we do

Donate & Support Us