ColorPickerPaletteColorView
A single color swatch in a color picker palette. This view represents an individual color that can be selected, dragged, and dropped within a color palette interface.
Features:
- Click to select the color
- Long press for additional actions (e.g., delete, edit)
- Drag and drop to reorder colors in the palette
- Visual feedback for press and drag states
The view maintains a square aspect ratio and provides transform-based visual feedback when pressed or dragged.
@event click Emitted when the color is clicked @event drop Emitted when the color is dropped after dragging @event longPress Emitted when the color is long-pressed
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
Drag and drop component for palette reordering
Whether this color swatch is currently being dragged
The color value represented by this swatch. Setting this updates the visual appearance.
Creates a new palette color swatch.
Name | Type | Default | Description |
---|---|---|---|
colorValue |
ceramic.Color | Color.WHITE |
The color to display (default: white) |
Private Members
Standard size for palette color swatches in pixels
Click detection component for color selection
Long press detection for context actions
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
ColorPickerPaletteColorView |
fromSerializedField |
Bool |
click event
Name | Type |
---|---|
instance |
ColorPickerPaletteColorView |
drop event
Name | Type |
---|---|
instance |
ColorPickerPaletteColorView |
longPress event
Name | Type |
---|---|
instance |
ColorPickerPaletteColorView |
info |
ceramic.TouchInfo |
Updates the visual transform based on interaction state.
- Dragging: follows drag position
- Pressed: slight downward offset
- Normal: no offset
Ensures dragged colors appear above other elements. Temporarily increases depth during drag operations.
Provides the visual to be dragged (the swatch itself).
Returns | Description |
---|---|
ColorPickerPaletteColorView | This color swatch view |
Called when drag operation ends. No cleanup needed as the swatch drags itself.
Name | Type | Description |
---|---|---|
visual |
ceramic.Visual | The visual that was dragged |
Handles drag state changes and emits drop event when dragging ends.
Name | Type | Description |
---|---|---|
dragging |
Bool | Current dragging state |
wasDragging |
Bool | Previous dragging state |
Returns a string representation of this color swatch.
Returns | Description |
---|---|
String | String in format "ColorPickerPaletteColorView(#RRGGBB)" |
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() |