ColorLightBox
classin packageklyn.gui.windows.dialogs
public class ColorLightBox extends LightBox:
└ ColorLightBox

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()
Properties
Modifier and Type Member Description
public readonly property selectedColor
selectedColor as Color:
Color selected by the last accepted interaction.
public property title
title as String
Heading displayed inside the lightbox.
Inherited Properties
propertyInherited Properties from LightBox: content, minPanelHeight, minPanelWidth, paddingX, paddingY, panelHeight, panelWidth
propertyInherited Properties from Container: autoRelayout, childCount, layout, padding
propertyInherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Events
Modifier and Type Member Description
public event accepted
accepted as ActionEvent
Emitted after the current color is accepted.
public event cancelled
cancelled as ActionEvent
Emitted after cancellation by the Cancel button or close icon.
Inherited Events
eventInherited Events from Widget: focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public ColorLightBox
ColorLightBox( selectedColor as Color = null, title as String = "Select color" ):
Creates an inactive color-selection lightbox.
Methods
Modifier and Type Member Description
public override close
close() as Void:
Cancels and closes the active chooser.
public open
open() as Void:
Opens the chooser over its containing window.
public setColor
setColor(color as Color) as Void:
Replaces the color used when the lightbox is next opened.
Inherited Methods
methodInherited Methods from LightBox: close, paint, setActive, setBounds
methodInherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Inherited Operators
operatorInherited Operators from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: