# Colours reference

> All 4 colours in AlgoBarsX, each with its parameters, defaults, ranges and an example: rgb, gradient, linear_gradient, radial_gradient.

Source: https://algobarsx.com/docs/ref-fn-colors/

### `rgb(red, green, blue, transparency = 0)` → color

Color from red, green, blue and optional transparency.

#### Parameters

| Name | Type | Default | Range | What it is |
| --- | --- | --- | --- | --- |
| `red` | int | required |  | 0 to 255. |
| `green` | int | required |  | 0 to 255. |
| `blue` | int | required |  | 0 to 255. |
| `transparency` | number | `0` | 0 to 100 | Percent transparent, 0 to 100. |

```algobarsx
brand = rgb(34, 197, 94)
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `gradient(value, low, high, from = 0, to = 100)` → color

Color between two colors according to a value.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `value` | number | required | Value to map. |
| `low` | color | required | Color at the low end. |
| `high` | color | required | Color at the high end. |
| `from` | number | `0` | Value mapped to low. |
| `to` | number | `100` | Value mapped to high. |

```algobarsx
heat = gradient(rsi(close, 14), low: red, high: green)
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `linear_gradient(start, end)` → fill

Linear gradient fill for shapes and channels.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `start` | color | required | Start color. |
| `end` | color | required | End color. |

```algobarsx
shade = linear_gradient(green.fade(60), green.fade(95))
```

Works in: strategy, indicator. Since 1.0.

### `radial_gradient(inner, outer)` → fill

Radial gradient fill for shapes.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `inner` | color | required | Center color. |
| `outer` | color | required | Edge color. |

```algobarsx
glow = radial_gradient(blue, blue.fade(100))
```

Works in: strategy, indicator. Since 1.0.
