Module colorizer.parser.rgb

RGB Parser This module provides a parser for identifying and converting rgb() and rgba() CSS functions to RGB hexadecimal format.

It supports decimal and percentage values for RGB channels, as well as an optional alpha (transparency) component. The function can interpret a variety of CSS syntax variations, making it useful for syntax highlighting or color parsing.

Functions

parser (line, i, opts) Parses rgb() and rgba() CSS functions and converts them to RGB hexadecimal format.

Tables

spec Parser spec for the registry


Functions

parser (line, i, opts)
Parses rgb() and rgba() CSS functions and converts them to RGB hexadecimal format. This function matches rgb() or rgba() functions in a line of text, extracting RGB and optional alpha values. It supports decimal and percentage formats, alpha transparency, and comma or space-separated CSS syntax.

Tables

spec
Parser spec for the registry
generated by LDoc 1.5.0 Last updated 2026-03-07 17:46:06