RGBA color (rgba() with an alpha channel)
ID rgbacolor
Pattern of colorNot PIIcategoricalDraft
This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).
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
color - Categories
- Common
- Countries
- Global (not tied to a country)
- Languages
- Common to most languages
- Quality
- 90/100 · missing: mapping (Wikidata, Schema.org, ...)
- Metacrafter rules
- 1 rule (0 by field name, 1 by value)
rgbacolorvaluedata, common/common.yaml
- Supported by tools
- metacrafter
Regular expression
^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*\)$
Python re syntax.
Test a value
Examples
| Value | Description |
|---|---|
| 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 | A component above 255 |
| rgb(255, 99, 71) invalid | Without alpha (rgbcolor) |
Translations
| Language | Name | Description |
|---|---|---|
| Russian | Цвет RGBA (rgba() с альфа-каналом) |
Sources
- wikipedia: RGBA color model (en.wikipedia.org)
- doc: w3.org/TR/css-color-4
Use this record
- Page URL:
https://registry.apicrafter.io/datatype/rgbacolor - JSON: API v1 · legacy shape (used by metacrafter) · Markdown (for LLMs)
- Improve it: edit
data/datatypes/any/common/rgbacolor.yamlon GitHub