> For the complete documentation index, see [llms.txt](https://luadoc.edgetx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luadoc.edgetx.org/lua-api-reference/display-lcd/rgb.md).

# 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](/lua-api-programming/drawing-flags-and-colors.md)

### Notes

### Available on

* [ ] [B\&W LCD radios](/overview/radios.md#radios-with-b-and-w-lcd-screen)
* [ ] [Grayscale LCD radios](/overview/radios.md#radios-with-grayscale-lcd-screen)
* [x] [Color LCD radios](/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](/lua-api-programming/drawing-flags-and-colors.md)
* [Color constants](/lua-api-reference/constants/color-constants.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
