public class ColorPicker extends Container:
Themed color-selection widget with RGB, HSV, HSL, color-wheel and spectrum modes.
The lower inspector keeps decimal and hexadecimal representations in sync, exposes a curated palette, and remembers colors explicitly committed by the user. color is a signal property suitable for one-way, two-way, or watched bindings.
import klyn.binding
import klyn.gui.windows
picker = ColorPicker(Color.fromHex("#3B82F6"))
Binding.watch(picker::color, lambda(value: Object): print(value))| Modifier and Type | Member | Description |
|---|---|---|
| public const | HSLHSL as String = "hsl" |
Hue, saturation and lightness selection mode. |
| public const | HSVHSV as String = "hsv" |
Hue, saturation and value selection mode. |
| public const | RGBRGB as String = "rgb" |
RGB channel selection mode. |
| public const | SPECTRUMSPECTRUM as String = "spectrum" |
Visual saturation/value square with a hue strip. |
| public const | WHEELWHEEL as String = "wheel" |
Hue wheel surrounding a saturation/value square. |
| Modifier and Type | Member | Description |
|---|---|---|
| public signal property | colorcolor as Color: |
Current selected color. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | ColorPickerColorPicker(color as Color = null, mode as String = ColorPicker.RGB): |
Creates a color picker. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | rememberCurrentColorrememberCurrentColor() as Void: |
Adds the current color to the recent-colors strip. |
| public | resetreset(color as Color) as Void: |
Starts a new selection while preserving the recent-colors history. |