ColorPickerHSBSpectrumView
A vertical hue spectrum selector for HSB color space.
This view displays a vertical gradient showing the full color spectrum from 0° to 360° (red to red through the rainbow). Users can select a hue by clicking or dragging along the spectrum.
Features:
- Smooth gradient mesh with configurable precision
- Interactive pointer with black/white borders for visibility
- Vertical layout (top = 360°/0° red, bottom = 0°/360° red)
- Observable pointer movement state
The spectrum is rendered as a mesh with multiple colored segments for smooth color transitions. The precision can be adjusted via the PRECISION constant.
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
Whether the pointer is currently being moved. Observable property for coordinating with other components.
The current hue value (0-360 degrees). Setting this updates the pointer position.
Creates a new HSB spectrum view.
Initializes:
- Gradient mesh with color spectrum
- Horizontal pointer with contrasting borders
- Pointer event handlers
Private Members
Number of color segments in the spectrum gradient. Higher values create smoother gradients.
The mesh displaying the color spectrum gradient.
The horizontal line pointer indicating the selected hue.
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
ColorPickerHSBSpectrumView |
fromSerializedField |
Bool |
Event emitted when the hue is updated via pointer interaction.
Event when movingPointer field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Initializes the spectrum gradient mesh. Creates a vertical gradient with segments for each hue value, distributed according to the PRECISION constant.
Updates the pointer position based on the current hue value. The pointer moves vertically with 0° at the bottom and 360° at the top.
Lays out the spectrum and pointer to fit the view dimensions.
Creates a color with maximum saturation and brightness for the given hue.
Name | Type | Description |
---|---|---|
hue |
Float | The hue value in degrees (0-360) |
Returns | Description |
---|---|
ceramic.AlphaColor | An AlphaColor with the specified hue at full saturation/brightness |
Name | Type |
---|---|
info |
ceramic.TouchInfo |
Name | Type |
---|---|
info |
ceramic.TouchInfo |
Name | Type |
---|---|
info |
ceramic.TouchInfo |
Updates the hue based on touch/pointer position. Calculates the hue from the Y coordinate (inverted so top = 360°).
Name | Type | Description |
---|---|---|
info |
ceramic.TouchInfo | Touch information containing pointer 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() |