SwatchPalette
import { SwatchPalette } from 'pixi-silk/ui/color';
Swatches to click: a fixed palette or the recent colours of a model, as a grid or a ring. Dragging across swatches previews them, releasing commits. The swatch matching the current colour wears a ring. A ring layout centres on the origin, a grid starts at it.
Extends#
Container
Constructors#
Constructor#
new SwatchPalette(options?: SwatchPaletteOptions): SwatchPalette;
Parameters#
| Parameter | Type |
|---|---|
options | SwatchPaletteOptions |
Returns#
SwatchPalette
Overrides#
Container.constructor
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
hovered | readonly | Signal<number> | Index of the swatch under the pointer, or -1. | ui/color/SwatchPalette.ts:51 |
model | readonly | ColorModel | The colour this palette writes to. | ui/color/SwatchPalette.ts:49 |
Accessors#
colors#
Get Signature#
get colors(): readonly number[];
Colours shown, in order, as 0xRRGGBB. The fixed colours, or the model’s history.
Returns
readonly number[]
Methods#
destroy()#
destroy(options?: DestroyOptions): void;
Stops the animation and unsubscribes from the model. Destroys children by default.
Parameters#
| Parameter | Type |
|---|---|
options? | DestroyOptions |
Returns#
void
Overrides#
Container.destroy
tick()#
tick(dt: number): boolean;
Advances the animation by dt seconds (only needed with ticker: null). Returns true while moving.
Parameters#
| Parameter | Type |
|---|---|
dt | number |
Returns#
boolean