phoenix::PhColor Class Reference

Color. More...

#include <PhColor.h>

List of all members.

Public Member Functions

 PhColor ()
 Constructor.
 PhColor (int x, int y, int z, int a=255)
 Constructor.
void setRed (int a)
 Set red.
void setGreen (int a)
 Set green.
void setBlue (int a)
 Set blue.
void setAlpha (int a)
 Set alpha.
int getRed ()
 Get red.
int getGreen ()
 Get green.
int getBlue ()
 Get blue.
int getAlpha ()
 Get alpha.
void setActiveColor ()
 Set active color.
int toGLColor ()
 To GL color.
PhColor interpolate (PhColor dest, float percent)
 Interpolate.


Detailed Description

Color.

Class to contain colors. Stores a color as RGBA wth values from 0-255.


Constructor & Destructor Documentation

phoenix::PhColor::PhColor ( int  x,
int  y,
int  z,
int  a = 255 
)

Constructor.

Parameters:
x Red component.
y Green component.
z Blue component.
a Alpha component (defualt 255)


Member Function Documentation

void phoenix::PhColor::setRed ( int  a  ) 

Set red.

Sets the red component of the color.

Parameters:
a Value from 0 to 255.
See also:
getRed()

void phoenix::PhColor::setGreen ( int  a  ) 

Set green.

Sets the green component of the color.

Parameters:
a Value from 0 to 255.
See also:
getGreen()

void phoenix::PhColor::setBlue ( int  a  ) 

Set blue.

Sets the blue. component of the color.

Parameters:
a Value from 0 to 255.
See also:
getBlue()

void phoenix::PhColor::setAlpha ( int  a  ) 

Set alpha.

Sets the alpha component of the color. 0 being completely transparent, 255 being fully opaque.

Parameters:
a Value from 0 to 255.
See also:
getAlpha().

int phoenix::PhColor::getRed (  ) 

Get red.

Returns:
The red component of the color.
See also:
setRed()

int phoenix::PhColor::getGreen (  ) 

Get green.

Returns:
The green component of the color.
See also:
setGreen()

int phoenix::PhColor::getBlue (  ) 

Get blue.

Returns:
The blue component of the color.
See also:
setBlue()

int phoenix::PhColor::getAlpha (  ) 

Get alpha.

Returns:
The alpha component of the color.
See also:
setAlpha()

void phoenix::PhColor::setActiveColor (  ) 

Set active color.

Makes this color the current active color for drawing.

int phoenix::PhColor::toGLColor (  ) 

To GL color.

This is used by all functions that draw things using indexed triangle lists.

Returns:
This color in encoded opengl format.
See also:
phoenix::PhRenderSystem::drawIndexedTriangleList()

PhColor phoenix::PhColor::interpolate ( PhColor  dest,
float  percent 
)

Interpolate.

Interpolates between the two colors by the given percent. Does not modify this color, instead returns the interpolated color.

Parameters:
dest What the color will be when it is interpolated 100%
percent What percent to interpolate.


The documentation for this class was generated from the following file:
Generated on Tue Nov 20 21:59:24 2007 for Phoenix by  doxygen 1.5.4