tbx
0.7.6
|
Class to represent a RGB colour. More...
#include <colour.h>
Public Member Functions | |
Colour () | |
Default constructor (creates black) | |
Colour (unsigned c) | |
Construct from a packed colour. More... | |
Colour (int red, int green, int blue) | |
Construct colour from rgb components. More... | |
void | red (int r) |
Change the red component of the colour. More... | |
void | green (int g) |
Change the green component of the colour. More... | |
void | blue (int b) |
Change the blue component of the colour. More... | |
int | red () const |
Return the amount of red in the colour. More... | |
int | green () const |
Return the amount of green in the colour. More... | |
int | blue () const |
Return the amount of blue in the colour. More... | |
operator unsigned () const | |
Return the colours packed into an unsigned integer. More... | |
Colour & | operator= (unsigned c) |
Set the colour from an unsigned integer. More... | |
Class to represent a RGB colour.
The colour is stored as an unsigned integer in the format 0xbbggrrxx where xx is normally 0 rr is the red component gg is the green component bb is the blue component. All components set to 0xFF (255) is used to represent no colour.
|
inline |
Construct from a packed colour.
c | colour in format 0xbbggrrxx |
|
inline |
Construct colour from rgb components.
Each component consists of a value from 0 to 255 with 0 being none and 255 being full.
red | amount of red 0 to 255 |
green | amount of green 0 to 255 |
blue | amount of blue 0 to 255 |
|
inline |
Return the amount of blue in the colour.
|
inline |
Change the blue component of the colour.
b | amount of blue from 0 to 255 |
|
inline |
Return the amount of green in the colour.
|
inline |
Change the green component of the colour.
g | amount of green from 0 to 255 |
|
inline |
Return the colours packed into an unsigned integer.
|
inline |
Set the colour from an unsigned integer.
c | colour in the format 0xbbggrrxx |
|
inline |
Return the amount of red in the colour.
|
inline |
Change the red component of the colour.
r | amount of red from 0 to 255 |