gre.to_rgb
gre.to_rgb(
color
)
Extract the red, green, blue and alpha components from a single color value.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | #number | The color value as a |
| number. |
Returns
| Type | Description |
|---|---|
#number | The red component. |
#number | The green component. |
#number | The blue component. |
#number | The alpha component. |
Example
-- Create a grey single color value
local grey = gre.rgb(100, 100, 100)
-- Extract the red, green and blue values from the grey
local r, g, b = gre.to_rgb(grey)