Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeColor Class Reference

represents a color value More...

#include <cascade/graphics/CascadeColor.h>

Inheritance diagram for CascadeColor:

CascadeObject List of all members.

Public Member Functions

 CascadeColor ()
 CascadeColor (u8 red, u8 green, u8 blue)
 CascadeColor (u8 red, u8 green, u8 blue, u8 alpha)
 CascadeColor (const CascadeColor &color)
void SetRed (u8 red)
void SetGreen (u8 green)
void SetBlue (u8 blue)
void SetAlpha (u8 alpha)
void SetRGB (u8 red, u8 green, u8 blue)
void SetRGBA (u8 red, u8 green, u8 blue, u8 alpha)
u8 GetRed ()
u8 GetGreen ()
u8 GetBlue ()
u8 GetAlpha ()
void GetRGB (u8 &redToSet, u8 &greenToSet, u8 &blueToSet)
void GetRGBA (u8 &redToSet, u8 &greenToSet, u8 &blueToSet, u8 &alphaToSet)
bool operator== (const CascadeColor &colorThat) const

Public Attributes

u32 m_nColor

Detailed Description

represents a color value

Skip the description

CascadeColor represents color as a 32 bit quantity where the high 24 bits encode eight bits of red, green, and blue respectively and the low 8 bits represent alpha.

Note:
An alpha value of 0 represents fully transparent; an alpha level of 255 represents fully opaque.

class CascadeColor


Constructor & Destructor Documentation

CascadeColor::CascadeColor  )  [inline]
 

default constructor

The default constructor for CascadeColor initializes the color to fully opaque black.

CascadeColor::CascadeColor u8  red,
u8  green,
u8  blue
[inline]
 

opaque color constructor

This constructor sets the color to a fully opaque color.

Parameters:
red the red value for the color
green the green value for the color
blue the blue value for the color

CascadeColor::CascadeColor u8  red,
u8  green,
u8  blue,
u8  alpha
[inline]
 

color constructor with alpha

This constructor sets the color to a color value with alpha.

Parameters:
red the red value for the color
green the green value for the color
blue the blue value for the color
alpha the alpha value for the color

CascadeColor::CascadeColor const CascadeColor color  )  [inline]
 

copy constructor

This copy constructor copies the color from the color passed in.

Parameters:
color the color to copy


Member Function Documentation

u8 CascadeColor::GetAlpha  )  [inline]
 

gets the alpha value of the color

GetAlpha() returns the alpha value of the color

Returns:
the alpha value of the color

u8 CascadeColor::GetBlue  )  [inline]
 

gets the blue value of the color

GetBlue() returns the blue value of the color

Returns:
the blue value of the color

u8 CascadeColor::GetGreen  )  [inline]
 

gets the green value of the color

GetGreen() returns the green value of the color

Returns:
the green value of the color

u8 CascadeColor::GetRed  )  [inline]
 

gets the red value of the color

GetRed() returns the red value of the color

Returns:
the red value of the color

void CascadeColor::GetRGB u8 redToSet,
u8 greenToSet,
u8 blueToSet
[inline]
 

gets the red, green, and blue values of the color

GetRGB() gets the red, green, and blue values of the color by setting the reference parameters passed into the function.

Parameters:
redToSet the variable in which to store the red value of the color
greenToSet the variable in which to store the green value of the color
blueToSet the variable in which to store the blue value of the color

void CascadeColor::GetRGBA u8 redToSet,
u8 greenToSet,
u8 blueToSet,
u8 alphaToSet
[inline]
 

gets the red, green, blue, and alpha values of the color

GetRGBA() gets the red, green, blue, and alpha values of the color by setting the reference parameters passed into the function.

Parameters:
redToSet the variable in which to store the red value of the color
greenToSet the variable in which to store the green value of the color
blueToSet the variable in which to store the blue value of the color
alphaToSet the variable in which to store the alpha value of the color

bool CascadeColor::operator== const CascadeColor colorThat  )  const [inline]
 

compars two colors for equality

This == operator compars two colors for equality

Parameters:
colorThat the color to compare this to
Returns:
whether or not the colors are equal

void CascadeColor::SetAlpha u8  alpha  )  [inline]
 

sets the alpha value of the color

SetAlpha() sets the alpha value of the color

Parameters:
alpha the alpha value to set

void CascadeColor::SetBlue u8  blue  )  [inline]
 

sets the blue value of the color

SetBlue() sets the blue value of the color

Parameters:
blue the blue value to set

void CascadeColor::SetGreen u8  green  )  [inline]
 

sets the green value of the color

SetGreen() sets the green value of the color

Parameters:
green the green value to set

void CascadeColor::SetRed u8  red  )  [inline]
 

sets the red value of the color

SetRed() sets the red value of the color

Parameters:
red the red value to set

void CascadeColor::SetRGB u8  red,
u8  green,
u8  blue
[inline]
 

sets the red, green and blue values of the color

SetRGB() sets the red, green and blue values of the color

Note:
SetRGB() doesn't touch the alpha value of the color
Parameters:
red the red value for the color
green the green value for the color
blue the blue value for the color

void CascadeColor::SetRGBA u8  red,
u8  green,
u8  blue,
u8  alpha
[inline]
 

sets the red, green, blue, and alpha values of the color

SetRGBA() sets the red, green, blue, and alpha values of the color

Parameters:
red the red value for the color
green the green value for the color
blue the blue value for the color
alpha the alpha value for the color


Member Data Documentation

u32 CascadeColor::m_nColor
 

stores the internal color value

m_nColor stores the encoded red, green, blue, and alpha values of the color in RGBA format.


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:18 2005 for Cascade Library by  doxygen 1.4.1