#include <color.h>
Represents a Color
Definition at line 13 of file color.h.
lc::Color::Color |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
a = 0xff |
|
) |
| |
|
inline |
Definition at line 16 of file color.h.
16 :
_r(std::min(std::max(0, r), 0xff) / 255.) ,
_g(std::min(std::max(0, g), 0xff) / 255.),
_b(std::min(std::max(0, b), 0xff) / 255.),
_a(std::min(std::max(0, a), 0xff) / 255.) {
lc::Color::Color |
( |
double |
r, |
|
|
double |
g, |
|
|
double |
b, |
|
|
double |
a = 1. |
|
) |
| |
|
inline |
Definition at line 18 of file color.h.
18 :
_r(std::min(std::max(0., r), 1.)),
_g(std::min(std::max(0., g), 1.)),
_b(std::min(std::max(0., b), 1.)),
_a(std::min(std::max(0., a), 1.)) {
lc::Color::Color |
( |
const Color & |
other | ) |
|
|
inline |
Definition at line 20 of file color.h.
20 :
_r(other._r),
_g(other._g),
_b(other._b),
_a(other._a) {}
virtual lc::Color::~Color |
( |
| ) |
|
|
inlinevirtual |
double lc::Color::alpha |
( |
| ) |
const |
|
inline |
unsigned char lc::Color::alphaI |
( |
| ) |
const |
|
inline |
Definition at line 63 of file color.h.
64 return std::round(
_a * 255);
double lc::Color::blue |
( |
| ) |
const |
|
inline |
unsigned char lc::Color::blueI |
( |
| ) |
const |
|
inline |
Definition at line 60 of file color.h.
61 return std::round(
_b * 255);
double lc::Color::green |
( |
| ) |
const |
|
inline |
unsigned char lc::Color::greenI |
( |
| ) |
const |
|
inline |
Definition at line 57 of file color.h.
58 return std::round(
_g * 255);
Color& lc::Color::operator= |
( |
const Color & |
other | ) |
|
|
inline |
double lc::Color::red |
( |
| ) |
const |
|
inline |
unsigned char lc::Color::redI |
( |
| ) |
const |
|
inline |
Definition at line 54 of file color.h.
55 return std::round(
_r * 255);
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Color & |
color |
|
) |
| |
|
friend |
Definition at line 67 of file color.h.
68 os <<
"Color(red=" << color._r <<
" green=" << color._g <<
" blue=" << color._b <<
" ahlpa=" << color._a <<
")";
The documentation for this class was generated from the following file: