Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
Color.h File Reference
#include <optional>
#include <ostream>
#include <string_view>
#include <variant>
Include dependency graph for Color.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::css::RGBA
 Represents as 32-bit RGBA color, with each component in the range [0, 255]. More...
 
struct  donner::css::HSLA
 Represents an HSLA color. More...
 
struct  donner::css::Color
 Represents a CSS color value, like a RGBA color from a #rrggbb or #rgb hex value, or the currentcolor keyword. More...
 
struct  donner::css::Color::CurrentColor
 Represents the currentColor keyword. More...
 

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
 
namespace  donner::css
 Donner CSS library, a standalone composable CSS parser.
 

Functions

constexpr Color donner::css::string_literals::operator""_rgb (unsigned long long value)
 String literal operator for constructing a donner::css::Color from hex values.
 
constexpr Color donner::css::string_literals::operator""_rgba (unsigned long long value)
 String literal operator for constructing a donner::css::Color from hex values, with an alpha channel.
 

Function Documentation

◆ operator""_rgb()

constexpr Color donner::css::string_literals::operator""_rgb ( unsigned long long value)
constexpr

String literal operator for constructing a donner::css::Color from hex values.

For example:

const Color red = 0xFF0000_rgb;
Parameters
valueInteger representation of the color value (without alpha, 24-bits used).

◆ operator""_rgba()

constexpr Color donner::css::string_literals::operator""_rgba ( unsigned long long value)
constexpr

String literal operator for constructing a donner::css::Color from hex values, with an alpha channel.

For example, for 50% opacity red:

const Color red = 0xFF000080_rgba;
Parameters
valueInteger representation of the color value.