format
typescript
new Color ((r, g, b, a))description
Create a color data with specified RGB and Alpha components.
parameter
| param_name | type | description |
|---|---|---|
| r | number? | The red component of the color (range from 0 to 1), default value is 1. |
| g | number? | The green component of the color (range from 0 to 1), default value is 1. |
| b | number? | The blue component of the color (range from 0 to 1), default value is 1. |
| a | number? | The alpha component of the color (0 is transparent, 1 is opaque), default value is 1. |
code example
javascript
let color0 = new Color();
let color1 = new Color(0.9);
let color2 = new Color(0.9, 0.8);
let color3 = new Color(0.9, 0.8, 0.7);
let color4 = new Color(0.9, 0.8, 0.7, 0.6);