Faith::Color Class Reference

Represents a color used in widgets. More...

#include <faith/color.h>

List of all members.

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)
Coloroperator= (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 ()


Detailed Description

Represents a color used in widgets.

Class representing a Graphics Device color


Member Enumeration Documentation

enum Faith::Color::Spec

Color specifications

Enumerator:
Rgb 
Hsv 


Constructor & Destructor Documentation

Faith::Color::Color (  ) 

Creates a invalid color

Faith::Color::Color ( int  r,
int  g,
int  b 
)

Creates a color with the given characteristics

Parameters:
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

Parameters:
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

Parameters:
rgb the color
pixel the window system value of the color

Faith::Color::Color ( const Color col  ) 

Copies the given color


Member Function Documentation

int Faith::Color::blue (  )  const [inline]

Color value request

Returns:
the red component of the color

the rgb triplet representing the color

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

Parameters:
factor darkening factor (100+)
Returns:
the darkened color

int Faith::Color::green (  )  const [inline]

Color value request

Returns:
the green component of the color

void Faith::Color::hsv ( int *  hue,
int *  sat,
int *  value 
) const

Color value request

Parameters:
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

Parameters:
factor lightening factor (100+)
Returns:
the lightened color

bool Faith::Color::operator!= ( const Color c  )  const [inline]

Color comparison

Returns:
true if the colors are different

Color& Faith::Color::operator= ( const Color col  ) 

Copies a color

bool Faith::Color::operator== ( const Color c  )  const

Color comparison

Returns:
true if the colors are identical

unsigned int Faith::Color::pixel (  )  const [inline]

Allocated color

Returns:
the window-system pixel value

int Faith::Color::red (  )  const [inline]

Color value request

Returns:
the red component of the color

Faith::Rgb Faith::Color::rgb (  )  const [inline]

Color value request

Returns:
the rgb triplet representing the color

void Faith::Color::rgb ( int *  red,
int *  green,
int *  blue 
) const [inline]

Color value request

Parameters:
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

Parameters:
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  ) 

Color value setting

Parameters:
rgb the new color setting

void Faith::Color::setRgb ( int  red,
int  green,
int  blue 
) [inline]

Color value setting

Parameters:
red the red component
green the green component
blue the blue component


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 00:23:08 2006 for Faith by  doxygen 1.4.7