#include <Color.h>
Public Methods | |
Color () | |
Default constructor, initializes R, G and B components to 0 and initializes A to 1. | |
Color (float r, float g, float b) | |
Initializes the R, G and B components to the specified values and initializes A to 1. | |
Color (float r, float g, float b, float a) | |
Initializes the components to the specified values. | |
float & | operator[] (int which) |
Mutable accessor for a Color component. | |
float | operator[] (int which) const |
Immutable accessor for a Color component. | |
const float * | toArray () const |
Retrieve the color as an array of floats. | |
Static Public Attributes | |
const int | R = 0 |
The R coordinate index in the array representing this Color. | |
const int | G = 1 |
The G coordinate index in the array representing this Color. | |
const int | B = 2 |
The B coordinate index in the array representing this Color. | |
const int | A = 3 |
The A coordinate index in the array representing this Color. | |
Private Methods | |
void | initialize (float r, float g, float b) |
Initializes the components to the specified values. | |
void | initialize (float r, float g, float b, float a) |
Initializes the components to the specified values. | |
Private Attributes | |
float | m_data [4] |
The data array containing the R, G, B and A values. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Color &col) |
Insertion operator for this Color into an output stream. |
|
Insertion operator for this Color into an output stream.
|