color(...)

color(val : number[]) : this;

Sets the current color value of the node, in the form [r, g, b, a]. Each component is a number between 0 and 1.

The final component, alpha, is the opacity of the object, where 0 is fully transparent and 1 is fully opaque.

Default value: [1, 1, 1, 1]

Parameters

Parameter Type Description
val number[] The value to set the color to, in the following form: [r, g, b, a].

Returns

this

Example

myobject.color([1, 0, 0, 1]);
// myobject is now red
zapcode branded_zapcode i