ColorPickerHSLuvSpectrumView
A vertical spectrum view for HSLuv color selection showing lightness values. This component displays a gradient from light to dark (top to bottom) for a specific hue and saturation combination in the HSLuv color space.
The spectrum provides:
- Vertical gradient showing lightness from 100% (top) to 0% (bottom)
- Interactive pointer for selecting lightness values
- Visual feedback with contrasting border colors for visibility
Used in conjunction with ColorPickerHSLuvGradientView to provide complete HSLuv color selection capabilities.
@event updateHueFromPointer Emitted when lightness is updated via pointer interaction
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
Observable flag indicating the pointer is being dragged
The current lightness value (0-1). Updates the pointer position when changed.
The hue value in degrees (0-360) used for the spectrum. Changing this regenerates the gradient colors.
The saturation value (0-1) used for the spectrum. Changing this regenerates the gradient colors.
Creates a new HSLuv spectrum view for lightness selection. Initializes the gradient mesh and horizontal pointer.
Private Members
Number of gradient segments for smooth lightness transitions
The mesh that renders the lightness gradient
Visual pointer indicating the current lightness selection
Flag to defer spectrum color updates until next frame
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
ColorPickerHSLuvSpectrumView |
fromSerializedField |
Bool |
updateHueFromPointer event
Event when movingPointer field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Initializes the spectrum mesh with vertices and indices. Creates a vertical gradient with the specified precision.
Updates the spectrum mesh colors based on current hue and saturation. Creates a smooth gradient from light to dark in HSLuv space.
Updates the pointer position based on the current lightness value. Positions the pointer vertically with light at top, dark at bottom.
Handles layout updates when the view is resized. Scales the spectrum mesh and adjusts pointer dimensions.
Creates a color with the specified lightness using current hue and saturation.
Name | Type | Description |
---|---|---|
lightness |
Float | The lightness value (0-1) |
Returns | Description |
---|---|
ceramic.AlphaColor | The resulting color in HSLuv space with full opacity |
Handles pointer down events to begin lightness selection.
Name | Type | Description |
---|---|---|
info |
ceramic.TouchInfo | Touch/mouse information |
Handles pointer move events during lightness selection. Sets the moving flag and updates the lightness value.
Name | Type | Description |
---|---|---|
info |
ceramic.TouchInfo | Touch/mouse information |
Handles pointer up events to end lightness selection. Clears the moving flag and finalizes the selection.
Name | Type | Description |
---|---|---|
info |
ceramic.TouchInfo | Touch/mouse information |
Updates the lightness value based on touch/mouse position. Converts vertical position to lightness (top=1, bottom=0).
Name | Type | Description |
---|---|---|
info |
ceramic.TouchInfo | Touch/mouse information containing screen coordinates |
Metadata
Name | Parameters |
---|---|
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |