38 #define cxCOLOR_CONV (0.003921568627450980392156862745098f) 45 Color(
const float _f) :
r(_f),
g(_f),
b(_f),
a(1.0f) {}
46 explicit Color(
const float _r,
const float _g,
const float _b)
47 :
r(_r),
g(_g),
b(_b),
a(1.0f) {}
48 explicit Color(
const float _r,
const float _g,
const float _b,
const float _a)
49 :
r(_r),
g(_g),
b(_b),
a(_a) {}
61 :
r(_c[0]),
g(_c[1]),
b(_c[2]),
a(_c[3]) {}
78 return ((
a >= 1.0f ? 255 :
a <= 0.0f ? 0 : (
uint32)(
a * 255.0f)) << 24) |
79 ((
r >= 1.0f ? 255 :
r <= 0.0f ? 0 : (
uint32)(
r * 255.0f)) << 16) |
80 ((
g >= 1.0f ? 255 :
g <= 0.0f ? 0 : (
uint32)(
g * 255.0f)) << 8) |
81 (
b >= 1.0f ? 255 :
b <= 0.0f ? 0 : (
uint32)(
b * 255.0f));
84 operator float* () {
return (
float*)(
c);}
112 stream <<
"Color(" << color.
r <<
"," << color.
g <<
"," << color.
b <<
"," << color.
a <<
")";
Color min(const Color &_c) const
Color operator+(const Color &_c) const
Color(const float _r, const float _g, const float _b)
Color & operator-=(const Color &c)
Color(const float _r, const float _g, const float _b, const float _a)
bool operator!=(const Color &_c) const
Color(const uint8 *pComponent)
Color & operator*=(const Color &c)
friend std::ostream & operator<<(std::ostream &stream, const Color &color)
bool operator==(const Color &_c) const
Color operator/(const Color &_c) const
Color & operator+=(const Color &c)
Color max(const Color &_c) const
Color & operator/=(const Color &c)
Color(uint8 _r, uint8 _g, uint8 _b)
static const Color Yellow
Color(uint8 _r, uint8 _g, uint8 _b, uint8 _a)
Color operator*(const Color &_c) const
static const Color LightGrey