#include <PhColor.h>
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. |
Class to contain colors. Stores a color as RGBA wth values from 0-255.
phoenix::PhColor::PhColor | ( | int | x, | |
int | y, | |||
int | z, | |||
int | a = 255 | |||
) |
Constructor.
x | Red component. | |
y | Green component. | |
z | Blue component. | |
a | Alpha component (defualt 255) |
void phoenix::PhColor::setRed | ( | int | a | ) |
void phoenix::PhColor::setGreen | ( | int | a | ) |
Set green.
Sets the green component of the color.
a | Value from 0 to 255. |
void phoenix::PhColor::setBlue | ( | int | a | ) |
Set blue.
Sets the blue. component of the color.
a | Value from 0 to 255. |
void phoenix::PhColor::setAlpha | ( | int | a | ) |
Set alpha.
Sets the alpha component of the color. 0 being completely transparent, 255 being fully opaque.
a | Value from 0 to 255. |
int phoenix::PhColor::getRed | ( | ) |
int phoenix::PhColor::getGreen | ( | ) |
int phoenix::PhColor::getBlue | ( | ) |
int phoenix::PhColor::getAlpha | ( | ) |
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.
Interpolate.
Interpolates between the two colors by the given percent. Does not modify this color, instead returns the interpolated color.
dest | What the color will be when it is interpolated 100% | |
percent | What percent to interpolate. |