wGui::CRGBColor Class Reference

The CRGBColor class is used for all wGui representations of color. More...

#include <wg_color.h>

Public Member Functions

Data Fields


Detailed Description

The CRGBColor class is used for all wGui representations of color.

Definition at line 38 of file wg_color.h.


Constructor & Destructor Documentation

wGui::CRGBColor::CRGBColor ( const unsigned char  r,
const unsigned char  g,
const unsigned char  b,
const unsigned char  a = 0xFF 
) [inline]

Construct a new color object

Parameters:
r Red component value
b Blue component value
g Green component value
a Alpha value, default value of 0xFF (fully opaque)

Definition at line 51 of file wg_color.h.

Referenced by MixNormal(), operator &(), operator+(), operator^(), and operator|().

wGui::CRGBColor::CRGBColor ( const Uint32 *  pColorValue,
const SDL_PixelFormat *  pFormat 
)

Construct a CRGBColor object from an SDL Color

Parameters:
pColorValue A pointer to the SDL Color
pFormat A pointer to the SDL Pixel Format

Definition at line 34 of file wg_color.cpp.

References alpha, blue, green, and red.

wGui::CRGBColor::CRGBColor ( std::wstring  sColor  ) 

Construct a CRGBColor object from a text string The string can be passed one of 2 ways. 1.) A color name - "RED" 2.) An RGB comma separated value - "255,0,0"

Parameters:
sColor The string to get the color code of

Definition at line 42 of file wg_color.cpp.

References alpha, stdex::atoi(), blue, stdex::DetokenizeString(), green, and red.


Member Function Documentation

unsigned long int wGui::CRGBColor::SDLColor ( SDL_PixelFormat *  pFormat  )  const [inline]

Convert the color so an SDL Color

Parameters:
pFormat A pointer to the SDL Pixel Format

Definition at line 68 of file wg_color.h.

References alpha, blue, green, and red.

Referenced by wGui::CPainter::DrawHLine(), wGui::CPainter::DrawPoint(), wGui::CPainter::DrawRect(), and wGui::CPainter::DrawVLine().

bool wGui::CRGBColor::operator== ( const CRGBColor c  )  const [inline]

Comparison operator does not take into account alpha values

Returns:
true if the Red, Green, and Blue color components are the same

Definition at line 73 of file wg_color.h.

References blue, green, and red.

bool wGui::CRGBColor::operator!= ( const CRGBColor c  )  const [inline]

Inequality operator does not take into accoutn alpha values

Returns:
true if any of the Red, Green, or Blue color components differ

Definition at line 80 of file wg_color.h.

References blue, green, and red.

CRGBColor wGui::CRGBColor::MixNormal ( const CRGBColor c  )  const

Does Normal color mixing

Parameters:
c The color to be applied as the foreground color

Definition at line 143 of file wg_color.cpp.

References alpha, blue, CRGBColor(), green, and red.

Referenced by wGui::CPainter::MixColor().


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:27 2007 for wGui by  doxygen 1.5.1