public class ColorLightBox extends LightBox:
Modal in-window lightbox for selecting a color.
Add the lightbox once to an overlay-capable root container, subscribe to accepted or cancelled, and call open() when a color is required. Modality is intrinsic to LightBox and is intentionally not configurable.
chooser = ColorLightBox(Color.fromHex("#3B82F6"))
chooser.accepted += lambda(event: ActionEvent): panel.backgroundColor = chooser.selectedColor
window.centralWidget.add(chooser)
chooser.open()| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | selectedColorselectedColor as Color: |
Color selected by the last accepted interaction. |
| public property | titletitle as String |
Heading displayed inside the lightbox. |
| Modifier and Type | Member | Description |
|---|---|---|
| public event | acceptedaccepted as ActionEvent |
Emitted after the current color is accepted. |
| public event | cancelledcancelled as ActionEvent |
Emitted after cancellation by the Cancel button or close icon. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | ColorLightBoxColorLightBox(
selectedColor as Color = null,
title as String = "Select color"
): |
Creates an inactive color-selection lightbox. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | closeclose() as Void: |
Cancels and closes the active chooser. |
| public | openopen() as Void: |
Opens the chooser over its containing window. |
| public | setColorsetColor(color as Color) as Void: |
Replaces the color used when the lightbox is next opened. |