47 struct {
char x, r, g, b; } _k;
78 void red(
int r) { _k.r = r; }
90 void blue(
int b) { _k.b = b; }
97 int red()
const {
return _k.r; }
109 int blue()
const {
return _k.b; }
116 operator unsigned()
const {
return _colour; }
128 enum { black = 0x00000000, white = 0xFFFFFF00,
129 light_red = 0x0000FF00, light_green = 0x00FF0000, light_blue = 0xFF000000,
130 magenta = 0xFFFF0000, yellow = 0x00FFFF00, cyan = 0xFFFF0000,
132 wimp_grey0 = 0xFFFFFF00, wimp_grey1 = 0xDDDDDD00, wimp_grey2 = 0xBBBBBB00,
133 wimp_grey3 = 0x99999900, wimp_grey4 = 0x77777700, wimp_grey5 = 0x55555500,
134 wimp_grey6 = 0x33333300, wimp_grey7 = 0x00000000,
135 wimp_dark_blue = 0x99440000, wimp_yellow = 0x00EEEE00,
136 wimp_light_green = 0x00CC0000, wimp_red = 0x0000DD00,
137 wimp_cream = 0xBBEEEE00, wimp_dark_green = 0x00885500,
138 wimp_orange = 0x00BBFF00, wimp_light_blue = 0xFFBB0000,
139 no_colour = 0xFFFFFFFF };
167 operator int()
const {
return _colour; }
180 enum { white = 0, grey0 = 0, grey1 = 1, grey2 = 2, grey3 = 3,
181 grey4 = 4, grey5 = 5, grey6 = 6, grey7 = 7, black = 7,
182 dark_blue = 8, yellow = 9, light_green = 10, red = 11, cream = 12,
183 dark_green = 13, orange = 14, light_blue = 15, no_colour = -1,
184 minimum = 0, maximum = 15 };
void blue(int b)
Change the blue component of the colour.
Definition: colour.h:90
Colour()
Default constructor (creates black)
Definition: colour.h:54
Class to represent a standard desktop WIMP colour.
Definition: colour.h:146
int blue() const
Return the amount of blue in the colour.
Definition: colour.h:109
WimpColour(int c)
Construct from an integer colour number.
Definition: colour.h:160
int green() const
Return the amount of green in the colour.
Definition: colour.h:103
Colour(unsigned c)
Construct from a packed colour.
Definition: colour.h:60
Colour(int red, int green, int blue)
Construct colour from rgb components.
Definition: colour.h:71
void red(int r)
Change the red component of the colour.
Definition: colour.h:78
int red() const
Return the amount of red in the colour.
Definition: colour.h:97
void green(int g)
Change the green component of the colour.
Definition: colour.h:84
Class to represent a RGB colour.
Definition: colour.h:43
WimpColour & operator=(int c)
Set colour number.
Definition: colour.h:175
Colour & operator=(unsigned c)
Set the colour from an unsigned integer.
Definition: colour.h:123
WimpColour()
Constructor creates black WIMP colour.
Definition: colour.h:154