format
typescript
Color.Get(index)class: Color
description
Get the color component based on the index.
parameter
| param_name | type | description |
|---|---|---|
| index | number | 0, get the red component (range from 0 to 1); 1, get the green component (range from 0 to 1); 2, get the blue component (range from 0 to 1); 3, get the alpha component (0 is transparent, 1 is opaque). |
reture
| type | description |
|---|---|
number | Returns the color component corresponding to the index. |
code example
typescript
let color = new Color(1,255,255,100);
color.Get(0);// get the red component
color.Get(1);// get the green component
color.Get(2);// get the blue component
color.Get(3);// get the alpha component