Module colorizer.parser.hsl
HSL Parser
This module provides a parser for identifying and converting hsl() and hsla() CSS functions to RGB hexadecimal format.
It supports various CSS color value formats, including degrees (deg), turns (turn), percentages, and alpha transparency.
This function is useful for syntax highlighting or color recognition in a text editor.
Functions
| parser (line, i, opts) | Parses hsl() and hsla() CSS functions and converts them to RGB hexadecimal format. |
Tables
| spec | Parser spec for the registry |
Functions
- parser (line, i, opts)
-
Parses
hsl()andhsla()CSS functions and converts them to RGB hexadecimal format. This function matcheshsl()orhsla()functions within a line of text, extracting and converting the hue, saturation, and luminance to an RGB color. It handles angles in degrees and turns, percentages, and an optional alpha (transparency) value.