#include <genesis/utils/color/color.hpp>
Definition at line 47 of file color.hpp.
|
static Color | from_bytes (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) |
| Create a Color given three or four values in the range [ 0, 255 ] for each of the components red, green and blue, and optionally alpha. More...
|
|
static Color | from_hex (std::string const &hex_color, std::string const &prefix="#") |
| Create a Color given a hex color string in the format "#003366[ff]". More...
|
|
◆ Color() [1/5]
Default constructor. Sets the color to black.
Definition at line 58 of file color.hpp.
◆ Color() [2/5]
Color |
( |
double |
r, |
|
|
double |
g, |
|
|
double |
b |
|
) |
| |
|
inline |
Constructor for setting the RGB value.
Definition at line 65 of file color.hpp.
◆ Color() [3/5]
Color |
( |
double |
r, |
|
|
double |
g, |
|
|
double |
b, |
|
|
double |
a |
|
) |
| |
Constructor for setting the RGB value including alpha.
Definition at line 46 of file color.cpp.
◆ ~Color()
◆ Color() [4/5]
◆ Color() [5/5]
◆ a() [1/2]
◆ a() [2/2]
◆ a_byte() [1/2]
unsigned char a_byte |
( |
| ) |
const |
|
inline |
◆ a_byte() [2/2]
void a_byte |
( |
unsigned char |
value | ) |
|
|
inline |
◆ b() [1/2]
◆ b() [2/2]
◆ b_byte() [1/2]
unsigned char b_byte |
( |
| ) |
const |
|
inline |
◆ b_byte() [2/2]
void b_byte |
( |
unsigned char |
value | ) |
|
|
inline |
◆ from_bytes()
Color from_bytes |
( |
unsigned char |
r, |
|
|
unsigned char |
g, |
|
|
unsigned char |
b, |
|
|
unsigned char |
a = 255 |
|
) |
| |
|
static |
Create a Color given three or four values in the range [ 0, 255 ]
for each of the components red, green and blue, and optionally alpha.
Definition at line 63 of file color.cpp.
◆ from_hex()
Color from_hex |
( |
std::string const & |
hex_color, |
|
|
std::string const & |
prefix = "#" |
|
) |
| |
|
static |
Create a Color given a hex color string in the format "#003366[ff]".
The hash sign in the beginning can be replaced by any given prefix. If the string is not correctly formatted, an std::invalid_argument exception is thrown. If the string contains only RGB, alpha is set to 1.0
.
Definition at line 68 of file color.cpp.
◆ g() [1/2]
◆ g() [2/2]
◆ g_byte() [1/2]
unsigned char g_byte |
( |
| ) |
const |
|
inline |
◆ g_byte() [2/2]
void g_byte |
( |
unsigned char |
value | ) |
|
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ r() [1/2]
◆ r() [2/2]
◆ r_byte() [1/2]
unsigned char r_byte |
( |
| ) |
const |
|
inline |
◆ r_byte() [2/2]
void r_byte |
( |
unsigned char |
value | ) |
|
|
inline |
◆ swap()
void swap |
( |
Color & |
other | ) |
|
|
inline |
The documentation for this class was generated from the following files: