An inline HSV colour picker: a saturation/value square, a vertical hue strip, a live
swatch + hex readout, and a row of preset swatches. Dragging the square sets saturation
(x) and value (y); dragging the strip sets hue; clicking a preset jumps to it. onChange
fires continuously while dragging with the opaque 0xFFRRGGBB colour.
The square and strip are gradient fills (no bitmaps), so the widget is cheap and repaints
only when the selection moves. It reuses UIColor.hsv / UIColor.toHSV.
Constructor
new(width:Float, ?initialColor:Int, ?onChange:Int ‑> Void)
Parameters:
width | layout width |
|---|---|
initialColor | the starting colour (default red) |
onChange | fired continuously while the colour changes |
Variables
presets:Array<Int> = [UIColor.opaque(0xE23D3D), UIColor.opaque(0xE2913D), UIColor.opaque(0xE2D63D), UIColor.opaque(0x53C24E), UIColor.opaque(0x3DB7E2), UIColor.opaque(0x4E63C2), UIColor.opaque(0x9B4EC2), UIColor.opaque(0xE2E2E2), UIColor.opaque(0x2A2A2E)]
Preset swatches shown in the bottom row (opaque colours).