Skip to content

lcd.RGB

Returns colorFlag in RGB565 format that can be used with lcd draw functions.

Syntax

lcd.RGB( r, g, b | rgb )

Parameters

NameReqTypeDescription
rtrueintegernumber between 0 (0x00) and 255 (0xFF) that expresses te amount of red in the color
gtrueinterernumber between (0x00) and 255 (0xFF) that expresses te amount of green in the color
btrueintegernumber between (0x00) and 255 (0xFF)that expresses te amount of blue in the color

or

NameReqTypeDescription
rgbtrueintegernumber between 0 (0x00) and 16777215 (0xFFFFFF) that expresses the RGB value (0xFF0000=RED, 0x00FF00=GREEN, 0x0000FF=BLUE)

Returns

Notes

Available on

API status

EdgeTX versionAction
2.3.0Introduced

Examples

Example 1

-- RGB numeric parameters
local darkred = lcd.RGB(20,0,0)  -- create color_flag for color
lcd.drawText(0,0,"Very dark red text", darkred)

Example 2

-- RGB hex parameter
local mygrey = lcd.RGB(0xAEAEAE)  -- create color_flag for color
lcd.drawText(0,20,"My grey color", mygrey)