# lcd.RGB

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

### Syntax

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

### Parameters

<table><thead><tr><th width="109">Name</th><th width="64" data-type="checkbox">Req</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td>r</td><td>true</td><td>integer</td><td>number between 0 (0x00) and 255 (0xFF) that expresses te amount of red in the color</td></tr><tr><td>g</td><td>true</td><td>interer</td><td>number between (0x00) and 255 (0xFF) that expresses te amount of green in the color</td></tr><tr><td>b</td><td>true</td><td>integer</td><td>number between (0x00) and 255 (0xFF)that expresses te amount of blue in the color</td></tr></tbody></table>

or

<table><thead><tr><th width="109">Name</th><th width="67" data-type="checkbox">Req</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td>rgb</td><td>true</td><td>integer</td><td>number between 0 (0x00) and 16777215 (0xFFFFFF) that expresses the RGB value (0xFF0000=RED, 0x00FF00=GREEN, 0x0000FF=BLUE)</td></tr></tbody></table>

### Returns

* `color_flag`. See [Drawing Flags](/2.11/lua-api-programming/drawing-flags-and-colors.md)

### Notes

### Available on

* [ ] [B\&W LCD radios](/2.11/overview/radios.md#radios-with-b-and-w-lcd-screen)
* [ ] [Grayscale LCD radios](/2.11/overview/radios.md#radios-with-grayscale-lcd-screen)
* [x] [Color LCD radios](/2.11/overview/radios.md#radios-with-color-lcd-screen)

### API status

<table><thead><tr><th width="166">EdgeTX version</th><th width="573">Action</th></tr></thead><tbody><tr><td>2.3.0</td><td>Introduced</td></tr></tbody></table>

### Examples

{% tabs %}
{% tab title="Example 1" %}

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

{% endtab %}

{% tab title="Example 2" %}

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

{% endtab %}
{% endtabs %}

### Related topics

* [Drawing flag](/2.11/lua-api-programming/drawing-flags-and-colors.md)
* [Color constants](/2.11/lua-api-reference/constants/color-constants.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://luadoc.edgetx.org/2.11/lua-api-reference/display-lcd/rgb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
