31 #ifndef _CEGUIColour_h_
32 #define _CEGUIColour_h_
34 #include "CEGUI/Base.h"
54 Colour(
float red,
float green,
float blue,
float alpha = 1.0f);
64 d_argb = calculateARGB();
71 float getAlpha(
void)
const {
return d_alpha;}
72 float getRed(
void)
const {
return d_red;}
73 float getGreen(
void)
const {
return d_green;}
74 float getBlue(
void)
const {
return d_blue;}
76 float getHue(
void)
const;
77 float getSaturation(
void)
const;
78 float getLumination(
void)
const;
85 inline void setAlpha(
float alpha)
91 inline void setRed(
float red)
97 inline void setGreen(
float green)
103 inline void setBlue(
float blue)
109 inline void set(
float red,
float green,
float blue,
float alpha = 1.0f)
118 inline void setRGB(
float red,
float green,
float blue)
126 inline void setRGB(
const Colour& val)
129 d_green = val.d_green;
133 d_argbValid = val.d_argbValid;
135 d_argb = (d_argb & 0xFF000000) | (val.d_argb & 0x00FFFFFF);
139 void setHSL(
float hue,
float saturation,
float luminance,
float alpha = 1.0f);
141 void invertColour(
void);
142 void invertColourWithAlpha(
void);
155 d_alpha = val.d_alpha;
157 d_green = val.d_green;
160 d_argbValid = val.d_argbValid;
167 setARGB(getARGB() & val);
173 setARGB(getARGB() & val.getARGB());
179 setARGB(getARGB() | val);
185 setARGB(getARGB() | val.getARGB());
189 inline Colour& operator<<=(
int val)
191 setARGB(getARGB() << val);
195 inline Colour& operator>>=(
int val)
197 setARGB(getARGB() >> val);
205 d_green + val.d_green,
207 d_alpha + val.d_alpha
215 d_green - val.d_green,
217 d_alpha - val.d_alpha
221 inline Colour operator*(
const float val)
const
234 d_blue *= val.d_blue;
235 d_green *= val.d_green;
236 d_alpha *= val.d_alpha;
248 return d_red == rhs.d_red &&
249 d_green == rhs.d_green &&
250 d_blue == rhs.d_blue &&
251 d_alpha == rhs.d_alpha;
256 return !(*
this == rhs);
262 operator argb_t()
const {
return getARGB();}
272 argb_t calculateARGB(
void)
const;
277 float d_alpha, d_red, d_green, d_blue;
279 mutable bool d_argbValid;
285 #endif // end of guard _CEGUIColour_h_