ColorField
import { ColorField } from 'pixi-silk/ui/inspector';
A colour swatch and its hex code. A press opens the colour picker.
Extends#
Constructors#
Constructor#
new ColorField(ctx: FieldContext, options: ColorFieldOptions): ColorField;
Parameters#
| Parameter | Type |
|---|---|
ctx | FieldContext |
options | ColorFieldOptions |
Returns#
ColorField
Overrides#
Properties#
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
opened | boolean | false | True while the picker is open. Set it with ColorField.setOpen. | ui/panels/fields.ts:762 |
Accessors#
colors#
Get Signature#
get colors(): readonly number[];
The colours shown, as 0xRRGGBB.
Returns
readonly number[]
fieldWidth#
Get Signature#
get fieldWidth(): number;
Width of the field box. Default 120 until Field.resize.
Returns
number
Inherited from#
swatch#
Get Signature#
get swatch(): Container;
The swatch, for placing the picker next to it.
Returns
Container
Methods#
destroy()#
destroy(options?: DestroyOptions): void;
Stops the animation. Destroys children unless options says otherwise.
Parameters#
| Parameter | Type |
|---|---|
options? | DestroyOptions |
Returns#
void
Inherited from#
resize()#
resize(width: number, height: number): void;
Sets the size of the field box and redraws.
Parameters#
| Parameter | Type |
|---|---|
width | number |
height | number |
Returns#
void
Inherited from#
setEnabled()#
setEnabled(on: boolean): void;
False dims the field and ignores input, while nothing is edited.
Parameters#
| Parameter | Type |
|---|---|
on | boolean |
Returns#
void
Inherited from#
setOpen()#
setOpen(open: boolean): void;
Marks the picker open or closed, which lights the field’s outline.
Parameters#
| Parameter | Type |
|---|---|
open | boolean |
Returns#
void
show()#
show(values: readonly unknown[]): void;
Shows the values of the edited objects, one per object. Differing values show as mixed. An empty list disables the field.
Parameters#
| Parameter | Type |
|---|---|
values | readonly unknown[] |
Returns#
void
Overrides#
tick()#
tick(dt: number): boolean;
Advances the motion by dt seconds (only needed with ticker: null). Returns true while moving.
Parameters#
| Parameter | Type |
|---|---|
dt | number |
Returns#
boolean