# RGBA
{: .no_toc }

Returns a **Long** representing an RGBA colour value, packing red, green, blue, and alpha components into a single 32-bit value.

Syntax: **RGBA(** *red* **,** *green* **,** *blue* **,** *alpha* **)**

*red*
: *required* A number in the range 0--255 representing the red component of the colour.

*green*
: *required* A number in the range 0--255 representing the green component of the colour.

*blue*
: *required* A number in the range 0--255 representing the blue component of the colour.

*alpha*
: *required* A number in the range 0--255 representing the alpha (opacity) component of the colour. **0** is fully transparent; **255** is fully opaque.

**RGBA** extends [**RGB**](/tB/Modules/Information/RGB.md) with an alpha channel for use with APIs that accept transparency. The component values can be read back with [**RGB_R**](/tB/Modules/Information/RGB_R.md), [**RGB_G**](/tB/Modules/Information/RGB_G.md), [**RGB_B**](/tB/Modules/Information/RGB_B.md), and [**RGBA_A**](/tB/Modules/Information/RGBA_A.md).

### Common Errors

| Error | When |
|---|---|
| [5 (`&H5`)](/Reference/Run-time-Errors.md#5), *Invalid procedure call or argument* | *red*, *green*, *blue* or *alpha* is negative |
| [94 (`&H5E`)](/Reference/Run-time-Errors.md#94), *Invalid use of Null* | *red*, *green*, *blue* or *alpha* is **Null** |

### Example

This example uses **RGBA** to build a semi-transparent red.

```tb check_build
Dim TranslucentRed As Long
TranslucentRed = RGBA(255, 0, 0, 128)
```

### See Also

- [RGB](/tB/Modules/Information/RGB.md) function
- [RGB_R](/tB/Modules/Information/RGB_R.md), [RGB_G](/tB/Modules/Information/RGB_G.md), [RGB_B](/tB/Modules/Information/RGB_B.md), [RGBA_A](/tB/Modules/Information/RGBA_A.md) functions
