#include <Color.h>
|
uint8_t | r = 0 |
|
uint8_t | g = 0 |
|
uint8_t | b = 0 |
|
uint8_t | a = 0 |
|
Color in A8B8G8R8 format.
◆ Color() [1/2]
constexpr Color::Color |
( |
| ) |
|
|
constexprdefault |
◆ Color() [2/2]
constexpr Color::Color |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
uint8_t |
a = 255 |
|
) |
| |
|
inlineconstexpr |
◆ c16()
uint16_t Color::c16 |
( |
| ) |
const |
|
inline |
◆ c32()
uint32_t Color::c32 |
( |
| ) |
const |
|
inline |
◆ fromC16()
static constexpr Color Color::fromC16 |
( |
uint16_t |
color | ) |
|
|
inlinestaticconstexpr |
◆ fromC32()
static Color Color::fromC32 |
( |
uint32_t |
color | ) |
|
|
inlinestatic |
◆ tag()
This function returns a tag that can then be used in fmt::format
calls to print out a color introducer.
For example:
std::string
s = fmt::format(
"{::}{}{::} more text",
Color(255, 255, 255).
tag(),
"text",
Color().
tag());
s
Definition: Json_ut.cpp:85
constexpr Color()=default
constexpr detail::ColorTag< Color > tag() const
Definition: Color.h:82
The code above will set string s
to "\f65535text\f00000 more text"
.
Note that the only supported format specifier for color tags is "{::}"
. This is done intentionally so that the user won't accidentally mix up color introducers with other fmt::format
args.
- Returns
- Tag that can be used with
fmt::format
.
◆ toColorf()
constexpr Colorf Color::toColorf |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator==
bool constexpr operator== |
( |
const Color & |
l, |
|
|
const Color & |
r |
|
) |
| |
|
friend |
The documentation for this struct was generated from the following file: