scatter 0.1.0
|
define a RGBA colour More...
#include <scatter/Colour.hpp>
Public Member Functions | |
Colour () | |
construct a black Colour | |
Colour (const double &r, const double &g, const double &b, const double &a) | |
constructor | |
Colour (const int &r, const int &g, const int &b, const int &a) | |
constructor | |
Colour (const int &hex) | |
constructor | |
virtual | ~Colour () |
destructor | |
const double & | r () const |
return the red part | |
const double & | g () const |
return the green part | |
const double & | b () const |
return the blue part | |
const double & | a () const |
return the alpha part | |
bool | operator== (const Colour &other) const |
Static Public Member Functions | |
static Colour | mix (const double &weight, const Colour &colour1, const Colour &colour2) |
[brief description] | |
static Colour | createFromHex (const int &hex) |
[brief description] | |
Static Public Attributes | |
static Colour | red |
define red colour | |
static Colour | blue |
define blue colour | |
static Colour | green |
define green colour | |
static Colour | yellow |
define yellow colour | |
static Colour | black |
define black colour | |
static Colour | white |
define white colour | |
static Colour | cyan |
define cyan colour | |
static Colour | pink |
define pink colour | |
Protected Member Functions | |
Colour (const std::array< double, 4 > &c) | |
internal constructor | |
define a RGBA colour
scatter::Colour::Colour | ( | const double & | r, |
const double & | g, | ||
const double & | b, | ||
const double & | a ) |
constructor
construct a colour with values 0 <= x <= 1
r | red, 0 <= r <= 1 |
g | green , 0 <= g <= 1 |
b | blue, 0 <= b <= 1 |
a | alpha, 0 <= a <= 1 |
scatter::Colour::Colour | ( | const int & | r, |
const int & | g, | ||
const int & | b, | ||
const int & | a ) |
constructor
construct a colour with values 0 <= x <= 255
r | red, 0 <= r <= 255 |
g | green , 0 <= g <= 255 |
b | blue, 0 <= b <= 255 |
a | alpha, 0 <= a <= 255 |
scatter::Colour::Colour | ( | const int & | hex | ) |
constructor
construct a colour from a hex string
hex_string | rgba |
|
virtual |
destructor
[long description]
|
protected |
internal constructor
convenice constructor to be able to iterate over the values for saturating them
c | array containing r,g,b,a values |
const double & scatter::Colour::a | ( | ) | const |
return the alpha part
[long description]
const double & scatter::Colour::b | ( | ) | const |
return the blue part
[long description]
|
static |
[brief description]
[long description]
hex | [description] |
const double & scatter::Colour::g | ( | ) | const |
return the green part
[long description]
|
static |
[brief description]
[long description]
weight | [description] |
colour1 | [description] |
colour2 | [description] |
const double & scatter::Colour::r | ( | ) | const |
return the red part
[long description]