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

# HSL color (`hslcolor`)

> **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 hue, saturation and lightness: a hue angle from 0 to 360 degrees and two percentages from 0% to 100%, separated by commas, either bare (0, 100%, 50%) or in the CSS functional notation hsl(0, 100%, 50%). The regexp accepts whole numbers only, without the deg unit, 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`):

```
^(?:hsl\(\s*(?:360|3[0-5]\d|[12]\d\d|[1-9]?\d)\s*,\s*(?:100|[1-9]?\d)%\s*,\s*(?:100|[1-9]?\d)%\s*\)|(?:360|3[0-5]\d|[12]\d\d|[1-9]?\d)\s*,\s*(?:100|[1-9]?\d)%\s*,\s*(?:100|[1-9]?\d)%)$
```

## Examples

- `hsl(0, 100%, 50%)` — Pure red
- `120, 100%, 25%` — Dark green
- `0, 0%, 100%` — White
- `361, 50%, 50%` (invalid example) — Hue above 360
- `120, 100, 25` (invalid example) — Saturation and lightness without %

## Mappings

- autotype: `hsl`

## Supported by tools

- `autotype`

## Translations

- ru: Цвет HSL: Цвет, записанный тоном (0–360°), насыщенностью и светлотой в процентах.

## Sources

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

## Quality

Score 100/100.

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