#include <faith/color.h>
Public Types | |
| Rgb | |
| Hsv | |
| enum | Spec { Rgb, Hsv } |
Public Member Functions | |
| Color () | |
| Color (int r, int g, int b) | |
| Color (int x, int y, int z, Spec colorSpec) | |
| Color (Faith::Rgb rgb, unsigned int pixel=0xffffffff) | |
| Color (const Color &col) | |
| Color & | operator= (const Color &col) |
| void | rgb (int *red, int *green, int *blue) const |
| Faith::Rgb | rgb () const |
| void | setRgb (int red, int green, int blue) |
| void | setRgb (Faith::Rgb rgb) |
| int | red () const |
| int | green () const |
| int | blue () const |
| void | hsv (int *hue, int *sat, int *value) const |
| void | setHsv (int hue, int sat, int value) |
| Color | light (int f=150) const |
| Color | dark (int f=200) const |
| bool | operator== (const Color &c) const |
| bool | operator!= (const Color &c) const |
| unsigned int | pixel () const |
Static Public Member Functions | |
| static void | initialize () |
| static void | cleanup () |
Class representing a Graphics Device color
| enum Faith::Color::Spec |
Color specifications
| Faith::Color::Color | ( | ) |
Creates a invalid color
| Faith::Color::Color | ( | int | r, | |
| int | g, | |||
| int | b | |||
| ) |
Creates a color with the given characteristics
| r | red value (0..255) | |
| g | green value (0..255) | |
| b | blue vaalue (0..255) |
| Faith::Color::Color | ( | int | x, | |
| int | y, | |||
| int | z, | |||
| Spec | colorSpec | |||
| ) |
Creates a color with the given characteristics
| x | red value (0..255) or hue value (-1..360) | |
| y | green value (0..255) or saturation value (0..255) | |
| z | blue value (0..255) or value (0..255) | |
| colorSpec | Color::Rgb or Color::Hsv |
| Faith::Color::Color | ( | Faith::Rgb | rgb, | |
| unsigned int | pixel = 0xffffffff | |||
| ) |
Creates a color with the given characteristics
| rgb | the color | |
| pixel | the window system value of the color |
| Faith::Color::Color | ( | const Color & | col | ) |
Copies the given color
| int Faith::Color::blue | ( | ) | const [inline] |
| static void Faith::Color::cleanup | ( | ) | [static] |
General cleanup function called by the Application destructor.
| Color Faith::Color::dark | ( | int | f = 200 |
) | const [inline] |
Returns a darker color
| factor | darkening factor (100+) |
| int Faith::Color::green | ( | ) | const [inline] |
| void Faith::Color::hsv | ( | int * | hue, | |
| int * | sat, | |||
| int * | value | |||
| ) | const |
Color value request
| hue | pointer to where to put the hue component (0-359 or -1 for achromatic) | |
| sat | pointer to where to put the saturation component (0-255) | |
| value | pointer to where to put the value component (0-255) |
| static void Faith::Color::initialize | ( | ) | [static] |
General initialization function called by the QApplication constructor.
| Color Faith::Color::light | ( | int | f = 150 |
) | const [inline] |
Returns a lighted color
| factor | lightening factor (100+) |
| bool Faith::Color::operator!= | ( | const Color & | c | ) | const [inline] |
| bool Faith::Color::operator== | ( | const Color & | c | ) | const |
| unsigned int Faith::Color::pixel | ( | ) | const [inline] |
Allocated color
| int Faith::Color::red | ( | ) | const [inline] |
| Faith::Rgb Faith::Color::rgb | ( | ) | const [inline] |
| void Faith::Color::rgb | ( | int * | red, | |
| int * | green, | |||
| int * | blue | |||
| ) | const [inline] |
Color value request
| red | pointer to where to put the red component | |
| green | pointer to where to put the green component | |
| blue | pointer to where to put the blue component |
| void Faith::Color::setHsv | ( | int | hue, | |
| int | sat, | |||
| int | value | |||
| ) |
Color value setting
| hue | the hue component (0-359 or -1 for achromatic) | |
| sat | the saturation component (0-255) | |
| value | the value component (0-255) |
| void Faith::Color::setRgb | ( | Faith::Rgb | rgb | ) |
| void Faith::Color::setRgb | ( | int | red, | |
| int | green, | |||
| int | blue | |||
| ) | [inline] |
Color value setting
| red | the red component | |
| green | the green component | |
| blue | the blue component |
1.4.7