Datatypes › color

HSL color

ID hslcolor

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 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 color
Categories
Common
Countries
Global (not tied to a country)
Languages
Common to most languages
AutoType benchmark
hsl
Quality
100/100
Metacrafter rules
no detection rule yet
Supported by tools
Auto-Type

Regular expression

^(?: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)%)$

Python re syntax.

Examples

ValueDescription
hsl(0, 100%, 50%)Pure red
120, 100%, 25%Dark green
0, 0%, 100%White
361, 50%, 50% invalidHue above 360
120, 100, 25 invalidSaturation and lightness without %

Translations

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

Sources

Use this record