Nana C++ Library. Reference for users.
What we need to use nana
|
Public Member Functions | |
color ()=default | |
color (colors) | |
color (colors, double alpha) | |
color (color_rgb) | |
color (color_argb) | |
color (color_rgba) | |
color (unsigned red, unsigned green, unsigned blue, double alpha=1.0) | |
color (std::string css_rgb) | |
Initializes the color with a CSS-like rgb string. More... | |
color & | alpha (double) |
Sets alpha channel. More... | |
color & | from_rgb (unsigned red, unsigned green, unsigned blue) |
immutable alpha channel More... | |
color & | from_hsl (double hue, double saturation, double lightness) |
immutable alpha channel More... | |
color | blend (const color &blending_color, double fade_rate) const |
Blends color. More... | |
bool | invisible () const |
Determines whether the color is completely transparent. More... | |
pixel_color_t | px_color () const |
pixel_argb_t | argb () const |
pixel_rgba_t | rgba () const |
const double & | r () const |
const double & | g () const |
const double & | b () const |
const double & | a () const |
bool | operator== (const color &other) const |
bool | operator!= (const color &other) const |
Friends | |
color | operator+ (const color &, const color &) |
|
default |
nana::color::color | ( | colors | clr | ) |
nana::color::color | ( | colors | clr, |
double | alpha | ||
) |
nana::color::color | ( | color_rgb | rgb | ) |
nana::color::color | ( | color_argb | argb | ) |
nana::color::color | ( | color_rgba | rgba | ) |
nana::color::color | ( | unsigned | red, |
unsigned | green, | ||
unsigned | blue, | ||
double | alpha = 1.0 |
||
) |
|
explicit |
Initializes the color with a CSS-like rgb string.
const double & nana::color::a | ( | ) | const |
color & nana::color::alpha | ( | double | al | ) |
Sets alpha channel.
pixel_argb_t nana::color::argb | ( | ) | const |
const double & nana::color::b | ( | ) | const |
Blends color.
Returns a color which is blended as this * (1 - fade_rate) + blending_color * fade_rate
blending_color | Color to blend |
fade_rate | Blending rate for blending_color |
color & nana::color::from_hsl | ( | double | hue, |
double | saturation, | ||
double | lightness | ||
) |
immutable alpha channel
Sets color with a HSL value.
hue | in range of [0, 360] |
saturation | in range of [0, 1] |
lightness | in range of [0, 1] |
color & nana::color::from_rgb | ( | unsigned | red, |
unsigned | green, | ||
unsigned | blue | ||
) |
immutable alpha channel
const double & nana::color::g | ( | ) | const |
bool nana::color::invisible | ( | ) | const |
Determines whether the color is completely transparent.
bool nana::color::operator!= | ( | const color & | other | ) | const |
bool nana::color::operator== | ( | const color & | other | ) | const |
pixel_color_t nana::color::px_color | ( | ) | const |
const double & nana::color::r | ( | ) | const |
pixel_rgba_t nana::color::rgba | ( | ) | const |