Skip to main content
Version: 9.0.2

gre.to_rgb

gre.to_rgb(
color
)

Extract the red, green, blue and alpha components from a single color value.

Parameters

ParameterTypeDescription
value#numberThe color value as a
number.

Returns

TypeDescription
#numberThe red component.
#numberThe green component.
#numberThe blue component.
#numberThe 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)