commons 0.1.5
Header-only C++23 library of common/shared types for the C++ libraries
Loading...
Searching...
No Matches
comms::CssColors Struct Reference

The CSS named colors as static constexpr Color values (the single source of truth for their hex), plus a case-insensitive name lookup via parse. More...

#include <color.hpp>

Collaboration diagram for comms::CssColors:

Static Public Member Functions

static constexpr std::optional< Colorparse (const std::string_view name)
 Resolve a CSS color name (case-insensitive) to its Color, or nullopt if the name is unknown.
 

Detailed Description

The CSS named colors as static constexpr Color values (the single source of truth for their hex), plus a case-insensitive name lookup via parse.

Member Function Documentation

◆ parse()

static constexpr std::optional< Color > comms::CssColors::parse ( const std::string_view  name)
inlinestaticconstexpr

Resolve a CSS color name (case-insensitive) to its Color, or nullopt if the name is unknown.

The lookup table references the members above, so color values live in exactly one place.


The documentation for this struct was generated from the following file: