Skip to content
pixi-silk
GitHub repository
Class

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#

ParameterType
optionsColorPickerOptions
labelstring

Returns#

ColorPicker

Overrides#

Container.constructor

Properties#

PropertyModifierTypeDescriptionDefined in
modelreadonlyColorModelThe colour this picker edits. Share it to link pickers.ui/color/ColorPicker.ts:36
statereadonlyColorPickerStateSignals 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#

ParameterType
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#

ParameterType
dtnumber

Returns#

boolean