#include <Types.h>
Public Member Functions | |
Color (double r=0.0, double g=0.0, double b=0.0, double a=1.0) | |
Constructor from separated components. | |
const double & | operator[] (size_t i) const |
access component i | |
double & | operator[] (size_t i) |
access component i | |
void | operator+= (double d) |
Add d to each component. | |
Color | operator+ (double d) const |
Add d to each component and return result in a new color. I'm left unchanged. | |
void | operator-= (double d) |
Substract d from each component. | |
Color | operator- (double d) const |
Substract d from each component and return result in a new color. I'm left unchanged. | |
void | operator *= (double d) |
Multiply each component with d. | |
Color | operator * (double d) const |
Multiply each component with d and return result in a new color. I'm left unchanged. | |
void | operator/= (double d) |
Divide each component with d. | |
Color | operator/ (double d) const |
Divide each component with d and return result in a new color. I'm left unchanged. | |
void | operator+= (const Color &oc) |
Add oc's components to ours. | |
Color | operator+ (const Color &oc) const |
Add oc's components to ours and return result in a new color. I'm left unchanged. | |
void | operator-= (const Color &oc) |
Substract oc's components to ours. | |
Color | operator- (const Color &oc) const |
Substract oc's components to ours and return result in a new color. I'm left unchanged. | |
bool | operator== (const Color &c) const |
Compare all components and return true if they're the same. | |
bool | operator!= (const Color &c) const |
Compare all components and return false if they're the same. | |
void | threshold (const Color &limit) |
Threshold the color using limit. For each component, if value is below limit, set it to 0. | |
double | gray () const |
Return the grey level value. | |
Public Attributes | |
double | components [4] |
RGBA values in range [0..1]. | |
Static Public Attributes | |
static const Color | black |
black (0, 0, 0) | |
static const Color | white |
white (1, 1, 1) | |
static const Color | red |
red (1, 0, 0) | |
static const Color | green |
green (0, 1, 0) | |
static const Color | blue |
blue (0, 0, 1) |