ColorPicker
import { ColorPicker } from 'pixi-silk/ui/color';
Base of the pickers. It binds to a ColorModel and turns presses into edits of one part
at a time: a drag keeps editing that part even outside it. Handles animate towards the model.
The colour field redraws only when it changes, the handles every frame they move. A drag writes
to the model continuously and calls model.commit() on release.
Extends#
Container
Extended by#
Constructors#
Constructor#
new ColorPicker(options: ColorPickerOptions, label: string): ColorPicker;
Parameters#
| Parameter | Type |
|---|---|
options | ColorPickerOptions |
label | string |
Returns#
ColorPicker
Overrides#
Container.constructor
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
model | readonly | ColorModel | The colour this picker edits. Share it to link pickers. | ui/color/ColorPicker.ts:36 |
state | readonly | ColorPickerState | Signals to read. See ColorPickerState. | ui/color/ColorPicker.ts:38 |
Methods#
destroy()#
destroy(options?: DestroyOptions): void;
Stops the animation and unsubscribes from the model. The model stays usable. 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