A growing implementation of CSS-related utilities. More...
Functions | |
| SOURCEMETA_CORE_CSS_EXPORT auto | sourcemeta::core::is_css2_hex_color (const std::string_view value) noexcept -> bool |
| SOURCEMETA_CORE_CSS_EXPORT auto | sourcemeta::core::is_css2_color_keyword (const std::string_view value) noexcept -> bool |
| SOURCEMETA_CORE_CSS_EXPORT auto | sourcemeta::core::is_css2_rgb_function (const std::string_view value) noexcept -> bool |
| SOURCEMETA_CORE_CSS_EXPORT auto | sourcemeta::core::is_css2_color (const std::string_view value) noexcept -> bool |
A growing implementation of CSS-related utilities.
This functionality is included as follows:
|
noexcept |
Check whether the given string is a valid CSS 2.1 <color> value per §4.3.6. The accept set is the union of:
For example:
|
noexcept |
Check whether the given string is one of the 17 CSS 2.1 color keywords defined in §4.3.6:
Matching is case-insensitive. The transparent keyword and the deprecated system colors (ButtonFace, ActiveBorder, etc.) are out of scope, as are the extended X11 names introduced by CSS Color Module Level 3. For example:
|
noexcept |
Check whether the given string is a valid CSS 2.1 hex color per §4.3.6. Accepts only the two hex notations defined by CSS 2.1:
Hex digits are case-insensitive. The 4-digit and 8-digit alpha forms from CSS Color Module Level 4 are not accepted. For example:
|
noexcept |
Check whether the given string is a valid CSS 2.1 functional RGB color per §4.3.6. Accepts both the integer and percentage forms:
All three values must be the same type. The function name rgb is case-insensitive, and CSS whitespace (space, tab, CR, LF, FF) is permitted between tokens. Out-of-range values are accepted (CSS 2.1 clamps at use time). The 4-argument rgba(...) form from CSS Color Module Level 3 is not accepted. For example: