lcd.RGB
Returns colorFlag in RGB565 format that can be used with lcd draw functions.
Syntax
lcd.RGB( r, g, b | rgb )
Parameters
| Name | Req | Type | Description |
|---|
| r | true | integer | number between 0 (0x00) and 255 (0xFF) that expresses te amount of red in the color |
| g | true | interer | number between (0x00) and 255 (0xFF) that expresses te amount of green in the color |
| b | true | integer | number between (0x00) and 255 (0xFF)that expresses te amount of blue in the color |
or
| Name | Req | Type | Description |
|---|
| rgb | true | integer | number between 0 (0x00) and 16777215 (0xFFFFFF) that expresses the RGB value (0xFF0000=RED, 0x00FF00=GREEN, 0x0000FF=BLUE) |
Returns
Notes
Available on
API status
| EdgeTX version | Action |
|---|
| 2.3.0 | Introduced |
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)