Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::parser::ColorParser Class Reference

Parse a CSS color, either from a string or the CSS intermediate representation, a list of ComponentValues. More...

#include "donner/css/parser/ColorParser.h"

Static Public Member Functions

static ParseResult< ColorParse (std::span< const ComponentValue > components)
 Parse a CSS color, per https://www.w3.org/TR/2021/WD-css-color-4-20210601/.
 
static ParseResult< ColorParseString (std::string_view str)
 Parse a CSS color from a string, per https://www.w3.org/TR/2021/WD-css-color-4-20210601/.
 

Detailed Description

Parse a CSS color, either from a string or the CSS intermediate representation, a list of ComponentValues.

Member Function Documentation

◆ Parse()

ParseResult< Color > donner::css::parser::ColorParser::Parse ( std::span< const ComponentValue > components)
static

Parse a CSS color, per https://www.w3.org/TR/2021/WD-css-color-4-20210601/.

Supports named colors, hex colors, and color functions such as rgb().

Parameters
componentsList of component values from the color declaration.
Returns
Parsed color.

◆ ParseString()

ParseResult< Color > donner::css::parser::ColorParser::ParseString ( std::string_view str)
static

Parse a CSS color from a string, per https://www.w3.org/TR/2021/WD-css-color-4-20210601/.

Supports named colors, hex colors, and color functions such as rgb().

Parameters
strString that can be parsed into a list color declaration.
Returns
Parsed color.

The documentation for this class was generated from the following files: