> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Color Functions

## `bar`

Renders a single bar in an ANSI bar chart using a default low\_color of red and a high\_color of green.  For example, if x of 25% and width of 40 are passed to this function. A 10-character red bar will be drawn followed by 30 spaces to create a bar of 40 characters.

*Supported Signatures*

```sql theme={null}
function bar(double, bigint) returns varchar
function bar(double, bigint, color, color) returns varchar
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/color.html#bar)

## `color`

Returns a color capturing a decoded RGB value from a 4-character string of the format “#000”.  The input string should be varchar containing a CSS-style short rgb string or one of black, red, green, yellow, blue, magenta, cyan, white.

*Supported Signatures*

```sql theme={null}
function color(double, color, color) returns color
function color(double, double, double, color, color) returns color
function color(varchar) returns color
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/color.html#color)

## `render`

Renders value x using the specific color using ANSI color codes. x can be either a double, bigint, or varchar.

*Supported Signatures*

```sql theme={null}
function render(boolean) returns varchar
function render(bigint, color) returns varchar
function render(double, color) returns varchar
function render(varchar, color) returns varchar
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/color.html#render)

## `rgb`

Returns a color value capturing the RGB value of three component color values supplied as int parameters ranging from 0 to 255. red, green, blue.

*Supported Signatures*

```sql theme={null}
function rgb(bigint, bigint, bigint) returns color
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/color.html#rgb)
