---
id: "hexcolor"
kind: "pattern"
status: "stable"
is_pii: false
categories: ["common"]
langs: ["common"]
quality: 95
url: "http://registry.apicrafter.io/datatype/hexcolor"
---

# sRGB color hex triplet (hex color) (`hexcolor`)

Color written as a hexadecimal sRGB triplet, for example #1F5FBF.

- 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`):

```
^#?(?:[0-9A-Fa-f]{3}){1,2}$
```

## Examples

- `#1F5FBF` — six hex digits with a leading #
- `FF8800` — six hex digits without #
- `#FFF` — short three-digit form

## Mappings

- autotype: `hexcolor`
- fta: `COLOR.HEX`
- wikidata: `P465`

## Supported by tools

- `autotype`
- `fta`
- `greatexpectations`
- `talend`

## Translations

- ru: Цвет в шестнадцатеричной кодировке: Цвет sRGB в шестнадцатеричной кодировке

## Sources

- wikidata: <https://www.wikidata.org/wiki/Property:P465>

## Quality

Score 95/100. Missing: negative example.

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