30 #ifndef _CEGUIColour_h_
31 #define _CEGUIColour_h_
33 #include "CEGUI/Base.h"
53 Colour(
float red,
float green,
float blue,
float alpha = 1.0f);
59 argb_t getARGB(
void)
const
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;}
82 float getHue(
void)
const;
91 float getSaturation(
void)
const;
100 float getLumination(
void)
const;
106 void setARGB(argb_t argb);
107 inline void setAlpha(
float alpha)
113 inline void setRed(
float red)
119 inline void setGreen(
float green)
125 inline void setBlue(
float blue)
131 inline void set(
float red,
float green,
float blue,
float alpha = 1.0f)
140 inline void setRGB(
float red,
float green,
float blue)
148 inline void setRGB(
const Colour& val)
151 d_green = val.d_green;
155 d_argbValid = val.d_argbValid;
157 d_argb = (d_argb & 0xFF000000) | (val.d_argb & 0x00FFFFFF);
161 void setHSL(
float hue,
float saturation,
float luminance,
float alpha = 1.0f);
163 void invertColour(
void);
164 void invertColourWithAlpha(
void);
169 inline Colour& operator=(argb_t val)
177 d_alpha = val.d_alpha;
179 d_green = val.d_green;
182 d_argbValid = val.d_argbValid;
187 inline Colour& operator&=(argb_t val)
189 setARGB(getARGB() & val);
195 setARGB(getARGB() & val.getARGB());
199 inline Colour& operator|=(argb_t val)
201 setARGB(getARGB() | val);
207 setARGB(getARGB() | val.getARGB());
211 inline Colour& operator<<=(
int val)
213 setARGB(getARGB() << val);
217 inline Colour& operator>>=(
int val)
219 setARGB(getARGB() >> val);
227 d_green + val.d_green,
229 d_alpha + val.d_alpha
237 d_green - val.d_green,
239 d_alpha - val.d_alpha
243 inline Colour operator*(
const float val)
const
256 d_blue *= val.d_blue;
257 d_green *= val.d_green;
258 d_alpha *= val.d_alpha;
270 return d_red == rhs.d_red &&
271 d_green == rhs.d_green &&
272 d_blue == rhs.d_blue &&
273 d_alpha == rhs.d_alpha;
278 return !(*
this == rhs);
284 operator argb_t()
const {
return getARGB();}
294 argb_t calculateARGB(
void)
const;
299 float d_alpha, d_red, d_green, d_blue;
300 mutable argb_t d_argb;
301 mutable bool d_argbValid;
307 #endif // end of guard _CEGUIColour_h_
Definition: MemoryAllocatedObject.h:109
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
uint32 argb_t
32 bit ARGB representation of a colour.
Definition: Colour.h:38
String CEGUIEXPORT operator+(const String &str1, const String &str2)
Return String object that is the concatenation of the given inputs.
Class representing colour values within the system.
Definition: Colour.h:44
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.