#include <vpcolor.h>
Public Member Functions | |
VPColor () | |
Creates a black, opaque color. | |
VPColor (const VPColor &color) | |
VPColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) | |
void | SetR (unsigned char r) |
void | SetG (unsigned char g) |
void | SetB (unsigned char b) |
void | SetA (unsigned char a) |
void | SetRGBA (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
unsigned char | GetR () const |
unsigned char | GetG () const |
unsigned char | GetB () const |
unsigned char | GetA () const |
void | GetRGBA (unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a) const |
void | Get (float rgbaVec[4]) const |
Returns RGBA componts as a vector of floats. | |
VPColor & | operator= (const VPColor &color) |
VPColor | operator+ (const VPColor &color) const |
VPColor | operator- (const VPColor &color) const |
bool | operator== (const VPColor &color) const |
bool | operator!= (const VPColor &color) const |
void | GetScaled (float escalar, float result[4]) const |
Multiplies RGB components, keeps A component. | |
void | GetScaled (float escalar, VPColor *result) const |
Multiplies RGB components, keeps A component. | |
Static Public Member Functions | |
static const VPColor & | BLACK () |
Black opaque color. | |
static const VPColor & | RED () |
Red opaque color. | |
static const VPColor & | GREEN () |
Green opaque color. | |
static const VPColor & | BLUE () |
Blue opaque color. | |
static const VPColor & | WHITE () |
White opaque color. | |
static VPColor | RANDOM () |
Returns a randomly chosen color. | |
Friends | |
std::ostream & | operator<< (std::ostream &output, const VPColor &c) |
Definition at line 15 of file vpcolor.h.
|
Creates a black, opaque color.
Definition at line 31 of file vpcolor.cpp. |
|
Definition at line 46 of file vpcolor.cpp. References rgba. |
|
Definition at line 38 of file vpcolor.cpp. |
|
Black opaque color.
Definition at line 53 of file vpcolor.cpp. Referenced by VPScene::VPScene(). |
|
Blue opaque color.
Definition at line 68 of file vpcolor.cpp. References blue. Referenced by VPMaterial::PLASTIC_BLUE(). |
|
Returns RGBA componts as a vector of floats.
Definition at line 106 of file vpcolor.cpp. Referenced by VPMaterial::DrawOGL(). |
|
|
|
|
|
|
|
|
|
Definition at line 98 of file vpcolor.cpp. |
|
Multiplies RGB components, keeps A component. Use this method to make a color darker, by multipling it by a number in the range 0..1.
Definition at line 155 of file vpcolor.cpp. References rgba. |
|
Multiplies RGB components, keeps A component. Use this method to make a color darker, by multipling it by a number in the range 0..1.
Definition at line 146 of file vpcolor.cpp. Referenced by VPScene::DrawOGL(), VPLight::DrawOGL(), and VPMaterial::VPMaterial(). |
|
Green opaque color.
Definition at line 63 of file vpcolor.cpp. References green. Referenced by VPMaterial::PLASTIC_GREEN(). |
|
Definition at line 139 of file vpcolor.cpp. References rgba. |
|
Definition at line 120 of file vpcolor.cpp. References rgba. |
|
Definition at line 126 of file vpcolor.cpp. References rgba. |
|
Definition at line 112 of file vpcolor.cpp. References rgba. |
|
Definition at line 132 of file vpcolor.cpp. References rgba. |
|
Returns a randomly chosen color. You may want to initialize the random number generator with something like: srand(static_cast<unsigned int>(time(NULL))) before generating random colors. Definition at line 78 of file vpcolor.cpp. |
|
Red opaque color.
Definition at line 58 of file vpcolor.cpp. References red. Referenced by VPMaterial::PLASTIC_RED(). |
|
Definition at line 25 of file vpcolor.h. Referenced by RANDOM(). |
|
Definition at line 24 of file vpcolor.h. Referenced by RANDOM(). |
|
Definition at line 23 of file vpcolor.h. Referenced by RANDOM(). |
|
Definition at line 22 of file vpcolor.h. Referenced by RANDOM(). |
|
Definition at line 91 of file vpcolor.cpp. Referenced by VPLight::VPLight(). |
|
White opaque color.
Definition at line 73 of file vpcolor.cpp. Referenced by VPLight::BRIGHT_AMBIENT(), and VPLight::SUN(). |
|
|