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);
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;}
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)
175 inline Colour& operator=(
const Colour& 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);
193 inline Colour& operator&=(
const Colour& val)
195 setARGB(getARGB() & val.getARGB());
199 inline Colour& operator|=(
argb_t val)
201 setARGB(getARGB() | val);
205 inline Colour& operator|=(
const Colour& 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);
223 inline Colour
operator+(
const Colour& val)
const
227 d_green + val.d_green,
229 d_alpha + val.d_alpha
233 inline Colour operator-(
const Colour& val)
const
237 d_green - val.d_green,
239 d_alpha - val.d_alpha
243 inline Colour operator*(
const float val)
const
253 inline Colour& operator*=(
const Colour& val)
256 d_blue *= val.d_blue;
257 d_green *= val.d_green;
258 d_alpha *= val.d_alpha;
268 inline bool operator==(
const Colour& rhs)
const
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;
276 inline bool operator!=(
const Colour& rhs)
const
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;
301 mutable bool d_argbValid;
Definition: MemoryAllocatedObject.h:110
Class representing colour values within the system.
Definition: Colour.h:46
float getLumination(void) const
Calculates and returns the lumination value based on the Colour.
float getSaturation(void) const
Calculates and returns the saturation value based on the Colour.
float getHue(void) const
Calculates and returns the hue value based on the Colour.
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
String CEGUIEXPORT operator+(const String &str1, const String &str2)
Return String object that is the concatenation of the given inputs.
uint32 argb_t
32 bit ARGB representation of a colour.
Definition: Colour.h:38
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.