31 #ifndef _CEGUIcolour_h_
32 #define _CEGUIcolour_h_
34 #include "CEGUIBase.h"
53 colour(
float red,
float green,
float blue,
float alpha = 1.0f);
63 d_argb = calculateARGB();
70 float getAlpha(
void)
const {
return d_alpha;}
71 float getRed(
void)
const {
return d_red;}
72 float getGreen(
void)
const {
return d_green;}
73 float getBlue(
void)
const {
return d_blue;}
75 float getHue(
void)
const;
76 float getSaturation(
void)
const;
77 float getLumination(
void)
const;
84 inline void setAlpha(
float alpha)
90 inline void setRed(
float red)
96 inline void setGreen(
float green)
102 inline void setBlue(
float blue)
108 inline void set(
float red,
float green,
float blue,
float alpha = 1.0f)
117 inline void setRGB(
float red,
float green,
float blue)
125 inline void setRGB(
const colour& val)
128 d_green = val.d_green;
132 d_argbValid = val.d_argbValid;
134 d_argb = (d_argb & 0xFF000000) | (val.d_argb & 0x00FFFFFF);
138 void setHSL(
float hue,
float saturation,
float luminance,
float alpha = 1.0f);
140 void invertColour(
void);
141 void invertColourWithAlpha(
void);
154 d_alpha = val.d_alpha;
156 d_green = val.d_green;
159 d_argbValid = val.d_argbValid;
166 setARGB(getARGB() & val);
172 setARGB(getARGB() & val.getARGB());
178 setARGB(getARGB() | val);
184 setARGB(getARGB() | val.getARGB());
188 inline colour& operator<<=(
int val)
190 setARGB(getARGB() << val);
194 inline colour& operator>>=(
int val)
196 setARGB(getARGB() >> val);
204 d_green + val.d_green,
206 d_alpha + val.d_alpha
214 d_green - val.d_green,
216 d_alpha - val.d_alpha
220 inline colour operator*(
const float val)
const
233 d_blue *= val.d_blue;
234 d_green *= val.d_green;
235 d_alpha *= val.d_alpha;
247 return d_red == rhs.d_red &&
248 d_green == rhs.d_green &&
249 d_blue == rhs.d_blue &&
250 d_alpha == rhs.d_alpha;
255 return !(*
this == rhs);
261 operator argb_t()
const {
return getARGB();}
271 argb_t calculateARGB(
void)
const;
276 float d_alpha, d_red, d_green, d_blue;
278 mutable bool d_argbValid;
284 #endif // end of guard _CEGUIcolour_h_