|
|
Donner
C++20 SVG rendering library
|
Represents as 32-bit RGBA color, with each component in the range [0, 255]. More...
#include "donner/css/Color.h"
Public Member Functions | |
| constexpr | RGBA ()=default |
| Default constructor, initializes to fully opaque white. | |
| constexpr | RGBA (uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
| Constructor, initializes to the given RGBA values. | |
| bool | operator== (const RGBA &) const =default |
| Equality operator. | |
| std::string | toHexString () const |
| Convert the color to a hex string, such as #ff0000. | |
Static Public Member Functions | |
| static constexpr RGBA | RGB (uint8_t r, uint8_t g, uint8_t b) |
| Constructor, for RGB colors, which are fully opaque. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const RGBA &color) |
| Ostream output operator. | |
Represents as 32-bit RGBA color, with each component in the range [0, 255].
To construct, with an alpha channel:
With no alpha:
| std::string donner::css::RGBA::toHexString | ( | ) | const |
Convert the color to a hex string, such as #ff0000.
|
friend |
Ostream output operator.
Outputs: rgba(r, g, b, a).
| os | The output stream. |
| color | The color to output. |