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 and decimal numbers (hsl(51.4285714286,50%,50%), as the color scales of Plotly charts write them), 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
- 1 rule (0 by field name, 1 by value)
hslcolorvaluedata, common/common.yaml
- Supported by tools
- Auto-Type, metacrafter, validator.js
Regular expression
^(?:hsl\(\s*(?:360(?:\.0+)?|(?:3[0-5]\d|[12]\d\d|[1-9]?\d)(?:\.\d+)?)\s*,\s*(?:100(?:\.0+)?|[1-9]?\d(?:\.\d+)?)%\s*,\s*(?:100(?:\.0+)?|[1-9]?\d(?:\.\d+)?)%\s*\)|(?:360(?:\.0+)?|(?:3[0-5]\d|[12]\d\d|[1-9]?\d)(?:\.\d+)?)\s*,\s*(?:100(?:\.0+)?|[1-9]?\d(?:\.\d+)?)%\s*,\s*(?:100(?:\.0+)?|[1-9]?\d(?:\.\d+)?)%)$
Python re syntax.
Test a value
Examples
| Value | Description |
|---|---|
| hsl(0, 100%, 50%) | Pure red |
| 120, 100%, 25% | Dark green |
| 0, 0%, 100% | White |
| hsl(51.4285714286,50%,50%) | decimal hue, as Plotly color scales write it |
| 361, 50%, 50% invalid | Hue above 360 |
| 120, 100, 25 invalid | Saturation and lightness without % |
Translations
| Language | Name | Description |
|---|---|---|
| Russian | Цвет HSL | Цвет, записанный тоном (0–360°), насыщенностью и светлотой в процентах. |
Sources
- wikipedia: HSL and HSV (en.wikipedia.org)
- doc: w3.org/TR/css-color-4
- other: github.com/congy/AutoType/blob/master/data_release/hsl.txt
Use this record
- Page URL:
https://registry.apicrafter.io/datatype/hslcolor - JSON: API v1 · legacy shape (used by metacrafter) · Markdown (for LLMs)
- Improve it: edit
data/datatypes/any/common/hslcolor.yamlon GitHub