30 Color(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a=255);
31 void SetR(
unsigned char r) { rgba[0] = r; }
32 void SetG(
unsigned char g) { rgba[1] = g; }
33 void SetB(
unsigned char b) { rgba[2] = b; }
34 void SetA(
unsigned char a) { rgba[3] = a; }
35 void SetRGBA(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a);
36 unsigned char GetR()
const {
return rgba[0]; }
37 unsigned char GetG()
const {
return rgba[1]; }
38 unsigned char GetB()
const {
return rgba[2]; }
39 unsigned char GetA()
const {
return rgba[3]; }
40 void GetRGBA(
unsigned char* r,
unsigned char* g,
unsigned char* b,
unsigned char* a)
const;
42 void Get(
float rgbaVec[4])
const;
58 void GetScaled(
float escalar,
float result[4])
const;
72 static Color HSV(
unsigned char h_,
unsigned char s_,
unsigned char v_);
98 unsigned char rgba[4];
static const Color & YELLOW()
Yellow opaque color.
static const Color & RED()
Red opaque color.
static const Color & BLUE()
Blue opaque color.
Color operator-(const Color &color) const
void GetRGBA(unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a) const
Color()
Creates a black, opaque color.
void SetR(unsigned char r)
void SetG(unsigned char g)
static const Color & GREEN()
Green opaque color.
bool operator==(const Color &color) const
unsigned char GetA() const
RGBA color representation.
static const Color & MAGENTA()
Magenta opaque color.
static Color HSV(unsigned char h_, unsigned char s_, unsigned char v_)
HSV named Constructor.
void SetRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
void SetB(unsigned char b)
unsigned char GetR() const
static const Color & CYAN()
Cyan opaque color.
void GetScaled(float escalar, float result[4]) const
Multiplies RGB components, keeps A component.
bool operator!=(const Color &color) const
static const Color & BLACK()
Black opaque color.
void Get(float rgbaVec[4]) const
Returns RGBA componts as a vector of floats.
static Color RANDOM()
Returns a randomly chosen color.
Color operator+(const Color &color) const
unsigned char GetG() const
Color & operator=(const Color &color)
static const Color & WHITE()
White opaque color.
friend std::ostream & operator<<(std::ostream &output, const Color &c)
void SetA(unsigned char a)
unsigned char GetB() const