---
id: "rgbacolor"
kind: "pattern"
status: "draft"
is_pii: false
name: "RGBA color (rgba() with an alpha channel)"
regexp: "^rgba ?\\(\\s*(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\s*,\\s*(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\s*,\\s*(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\s*,\\s*(?:0|1|0?\\.\\d+|1\\.0+)\\s*\\)$"
categories: ["common"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/rgbacolor"
---

# RGBA color (rgba() with an alpha channel) (`rgbacolor`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Color in the CSS functional notation rgba(): red, green and blue from 0 to 255 and an opacity (alpha) from 0 (transparent) to 1 (opaque), as rgba(179, 226, 205, 1) or rgba(222,45,38,0.8). Charting libraries such as Plotly and Chart.js and stylesheets write colors with transparency this way, and chart exports keep them in the color fields of traces and markers. The form without alpha is rgbcolor, the hexadecimal one hexcolor. The regexp does not cover percentages or the space-separated syntax of CSS Color Level 4.

- Pattern of: [`color`](https://registry.apicrafter.io/datatype/color.md)
- Personal data (PII): no
- Categories: Common (common)
- Countries: global
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^rgba ?\(\s*(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\s*,\s*(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\s*,\s*(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\s*,\s*(?:0|1|0?\.\d+|1\.0+)\s*\)$
```

## Examples

- `rgba(179,226,205,1)`
- `rgba(222, 45, 38, 0.8)`
- `rgba(0,0,0,0)` — fully transparent
- `rgba (255, 0, 0, 1)` — with a space after rgba, as older Plotly figures write it
- `rgba(256,0,0,1)` (invalid example) — A component above 255
- `rgb(255, 99, 71)` (invalid example) — Without alpha (rgbcolor)

## Metacrafter rules

1 rules: 0 match the field name, 1 match values.

- `rgbacolorvalue` (data, `common/common.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- ru: Цвет RGBA (rgba() с альфа-каналом)

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/RGBA_color_model>
- doc: <https://www.w3.org/TR/css-color-4/#rgb-functions>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/rgbacolor.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/common/rgbacolor.yaml>
