Skip to content

ColorPicker

Interactive color selection control providing RGBA sliders, hex input, and popup palette.

Overview

ColorPicker displays an interactive color swatch preview button and an expandable popup editor supporting RGBA channels, alpha transparency, hex strings, and change events.

Basic ColorPicker

ColorPicker picker = new ColorPicker()
        .argb(0xFFFF8800);
picker.onColorChanged(e -> updateThemeColor(e.newColor()));

API

ColorPicker::argb()

Get ARGB

Returns current packed 32-bit ARGB integer value.

Returns int.

ColorPicker::argb(int)

Set ARGB

Sets picker color from packed 32-bit ARGB value.

Parameter Type Description
argb int —

Returns ColorPicker.

ColorPicker::color()

Get Color

Returns current ColorView representation.

Returns ColorView.

ColorPicker::color(ColorView)

Set Color

Sets picker color from ColorView.

Parameter Type Description
color ColorView —

Returns ColorPicker.

ColorPicker::onColorChanged(EventListener)

On Color Changed

Registers event listener triggered on color changes.

Parameter Type Description
listener EventListener —

Returns EventSubscription.

Get Popup

Returns overlay popup hosting channel sliders.

Returns Popup.

ColorPicker::preview()

Preview Button

Returns internal swatch preview button widget.

Returns Button.

ColorPicker::rgba255(int, int, int, int)

Set RGBA 0-255

Sets picker color with 0-255 channel integers.

Parameter Type Description
red int —
green int —
blue int —
alpha int —

Returns ColorPicker.

ColorPicker::type()

Get Type

Returns color picker display type (RGB or RGBA).

Returns Type.

ColorPicker::type(Type)

Set Type

Sets color picker display mode.

Parameter Type Description
type Type —

Returns ColorPicker.