---
id: "rgbcolor"
kind: "pattern"
status: "draft"
is_pii: false
categories: ["common"]
langs: ["common"]
quality: 100
url: "http://registry.apicrafter.io/datatype/rgbcolor"
---

# RGB color triplet (`rgbcolor`)

> **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 written as its red, green and blue components: three integers from 0 to 255 separated by commas, either bare (220,220,220) or in the CSS functional notation rgb(220, 220, 220). Design tools, data exports and stylesheets use it; the hexadecimal form of the same color is hexcolor. The regexp does not cover percentages, an alpha channel or the space-separated syntax of CSS Color Level 4.

- Pattern of: `color`
- Personal data (PII): no
- Categories: Common (common)
- Countries: global
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^(?:rgb\(\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*\)|(?: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))$
```

## Examples

- `220,220,220` — CSS named color gainsboro
- `rgb(255, 99, 71)` — CSS named color tomato
- `0, 0, 0` — Black
- `256,0,0` (invalid example) — A component above 255
- `#FF6347` (invalid example) — Hexadecimal form

## Mappings

- autotype: `rgb`

## Supported by tools

- `autotype`

## Translations

- ru: Цвет RGB: Цвет, записанный тремя компонентами (красный, зелёный, синий) от 0 до 255.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/RGB_color_model>
- doc: <https://www.w3.org/TR/css-color-4/#rgb-functions>
- other: <https://github.com/congy/AutoType/blob/master/data_release/rgb.txt>

## Quality

Score 100/100.

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