| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/color.h>

Public Member Functions | |
| Color (float grey=0.0f) | |
| Color (double grey) | |
| Sets the r, g and b components to the given grey value and the alpha component to one. | |
| Color (float red, float green, float blue, float alpha=1.0f) | |
| Color (double red, double green, double blue, double alpha=1.0) | |
| Constructs a color with the given component values. | |
| bool | operator== (const Color &other) const |
| Returns whether two colors match in all four components. | |
| bool | operator!= (const Color &other) const |
| Returns whether two colors differ in one of the four components. | |
| bool | operator< (const Color &other) const |
| Returns whether this color is lexicographically smaller than the "other" color. | |
| float & | operator[] (unsigned int i) |
| Returns one of the components, indexed by R=[0], G=[1], B=[2], and A=[3]. | |
| float | operator[] (unsigned int i) const |
| Returns one of the components, indexed by R=[0], G=[1], B=[2], and A=[3]. | |
| Color & | operator+= (const Color &col) |
| Adds the r, g and b components of a color. | |
| Color & | operator-= (const Color &col) |
| Subtracts the r, g and b components of a color. | |
| Color & | operator*= (float coef) |
| Color & | operator*= (double coef) |
| Multiplies the r, g and b components by a value. | |
| Color & | operator/= (float coef) |
| Color & | operator/= (double coef) |
| Divides the r, g and b components by a value. | |
| Color | operator+ (const Color &col) const |
| The r, g and b components of two colors are added. | |
| Color | operator- (const Color &col) const |
| The r, g and b components of two colors are subtracted. | |
| Color | operator* (float coef) const |
| Color | operator* (double coef) const |
| The r, g and b components of a colors are multiplied with a given value. | |
| Color | operator/ (float coef) const |
| Color | operator/ (double coef) const |
| The r, g and b components of a colors are divided by a given value. | |
| float | hue () const |
| Returns the hsv hue of a rgb color. | |
| float | saturation () const |
| Returns the hsv saturation of a rgb color. | |
| float | value () const |
| Returns the hsv value of a rgb color. | |
| float | luminance () const |
| Returns the luminance of the color. | |
Static Public Member Functions | |
| static Color | hsv (float hue, float saturation, float value, float alpha=1.0f) |
| static Color | hsv (double hue, double saturation, double value, double alpha=1.0) |
| Constructs a rgba color by hsva values. | |
Static Public Attributes | |
| static const Color | aquamarine |
| static const Color | black |
| static const Color | blue |
| static const Color | blue_violet |
| static const Color | brilliant_red |
| static const Color | brown |
| static const Color | cadet_blue |
| static const Color | coral |
| static const Color | cornflower_blue |
| static const Color | cyan |
| static const Color | dk_brown |
| static const Color | dk_gray |
| static const Color | dk_green |
| static const Color | dk_olive_green |
| static const Color | dk_orchid |
| static const Color | dk_plum |
| static const Color | dk_slate_blue |
| static const Color | dk_slate_gray |
| static const Color | dk_tan |
| static const Color | dk_turquoise |
| static const Color | dim_brown |
| static const Color | dim_gray |
| static const Color | firebrick |
| static const Color | forest_green |
| static const Color | gold |
| static const Color | goldenrod |
| static const Color | gray |
| static const Color | green |
| static const Color | green_yellow |
| static const Color | grey |
| static const Color | indian_red |
| static const Color | khaki |
| static const Color | lt_blue |
| static const Color | lt_gray |
| static const Color | lt_sky_blue |
| static const Color | lt_steel_blue |
| static const Color | lime_green |
| static const Color | magenta |
| static const Color | maroon |
| static const Color | med_aquamarine |
| static const Color | med_blue |
| static const Color | med_brown |
| static const Color | med_forest_green |
| static const Color | med_goldenrod |
| static const Color | med_gray |
| static const Color | med_grey |
| static const Color | med_orchid |
| static const Color | med_plum |
| static const Color | med_sea_green |
| static const Color | med_slate_blue |
| static const Color | med_spring_green |
| static const Color | med_turquoise |
| static const Color | med_violet_red |
| static const Color | midnight_blue |
| static const Color | navy |
| static const Color | navy_blue |
| static const Color | orange |
| static const Color | orange_red |
| static const Color | orchid |
| static const Color | pale_green |
| static const Color | pink |
| static const Color | plum |
| static const Color | red |
| static const Color | salmon |
| static const Color | sea_green |
| static const Color | sienna |
| static const Color | silver |
| static const Color | sky_blue |
| static const Color | slate_blue |
| static const Color | slate_gray |
| static const Color | spring_green |
| static const Color | steel_blue |
| static const Color | med_tan |
| static const Color | thistle |
| static const Color | turquoise |
| static const Color | violet |
| static const Color | violet_red |
| static const Color | wheat |
| static const Color | white |
| static const Color | yellow |
| static const Color | yellow_green |
| VRS::Color::Color | ( | float | grey = 0.0f |
) | [explicit] |
| VRS::Color::Color | ( | double | grey | ) | [explicit] |
Sets the r, g and b components to the given grey value and the alpha component to one.
| VRS::Color::Color | ( | float | red, | |
| float | green, | |||
| float | blue, | |||
| float | alpha = 1.0f | |||
| ) |
| VRS::Color::Color | ( | double | red, | |
| double | green, | |||
| double | blue, | |||
| double | alpha = 1.0 | |||
| ) |
Constructs a color with the given component values.
| bool VRS::Color::operator== | ( | const Color & | other | ) | const [inline] |
Returns whether two colors match in all four components.
| bool VRS::Color::operator!= | ( | const Color & | other | ) | const [inline] |
Returns whether two colors differ in one of the four components.
| bool VRS::Color::operator< | ( | const Color & | other | ) | const [inline] |
Returns whether this color is lexicographically smaller than the "other" color.
| float & VRS::Color::operator[] | ( | unsigned int | i | ) | [inline] |
Returns one of the components, indexed by R=[0], G=[1], B=[2], and A=[3].
Reimplemented from VRS::VertexData< 4, float >.
| float VRS::Color::operator[] | ( | unsigned int | i | ) | const [inline] |
Returns one of the components, indexed by R=[0], G=[1], B=[2], and A=[3].
Reimplemented from VRS::VertexData< 4, float >.
Adds the r, g and b components of a color.
The alpha value will not be modified. The result of each operation is clamped to [0.0, 1.0].
Subtracts the r, g and b components of a color.
The alpha value will not be modified. The result of each operation is clamped to [0.0, 1.0].
| Color& VRS::Color::operator*= | ( | float | coef | ) |
| Color& VRS::Color::operator*= | ( | double | coef | ) |
Multiplies the r, g and b components by a value.
The alpha value will not be modified. The result of each operation is clamped to [0.0, 1.0].
| Color & VRS::Color::operator/= | ( | float | coef | ) | [inline] |
| Color & VRS::Color::operator/= | ( | double | coef | ) | [inline] |
Divides the r, g and b components by a value.
The alpha value will not be modified. The result of each operation is clamped to [0.0, 1.0].
The r, g and b components of two colors are added.
The alpha value will be taken from the left color. The result of each operation is clamped to [0.0, 1.0].
The r, g and b components of two colors are subtracted.
The alpha value will be taken from the left color. The result of each operation is clamped to [0.0, 1.0].
| Color VRS::Color::operator* | ( | float | coef | ) | const [inline] |
| Color VRS::Color::operator* | ( | double | coef | ) | const [inline] |
The r, g and b components of a colors are multiplied with a given value.
The alpha value will not be multiplied. The result of each operation is clamped to [0.0, 1.0].
| Color VRS::Color::operator/ | ( | float | coef | ) | const [inline] |
| Color VRS::Color::operator/ | ( | double | coef | ) | const [inline] |
The r, g and b components of a colors are divided by a given value.
The alpha value will not be multiplied. The result of each operation is clamped to [0.0, 1.0].
| static Color VRS::Color::hsv | ( | float | hue, | |
| float | saturation, | |||
| float | value, | |||
| float | alpha = 1.0f | |||
| ) | [static] |
| static Color VRS::Color::hsv | ( | double | hue, | |
| double | saturation, | |||
| double | value, | |||
| double | alpha = 1.0 | |||
| ) | [static] |
Constructs a rgba color by hsva values.
Provide the conversion between the GB and HSV color models. hsv can specify achromatic (gray-scale) colors by setting `s' to 0.0 and `v' to the gray coefficient between [0,1]. The hue factor must be specified in degrees in the range [0,360]. Both saturation and value must be in the range [0,1].
| float VRS::Color::hue | ( | ) | const |
Returns the hsv hue of a rgb color.
| float VRS::Color::saturation | ( | ) | const |
Returns the hsv saturation of a rgb color.
| float VRS::Color::value | ( | ) | const |
Returns the hsv value of a rgb color.
| float VRS::Color::luminance | ( | ) | const |
Returns the luminance of the color.
That is, the weighted sum of the red (30%), green (55%), and blue (15%) coefficients.
const Color VRS::Color::aquamarine [static] |
const Color VRS::Color::black [static] |
const Color VRS::Color::blue [static] |
const Color VRS::Color::blue_violet [static] |
const Color VRS::Color::brilliant_red [static] |
const Color VRS::Color::brown [static] |
const Color VRS::Color::cadet_blue [static] |
const Color VRS::Color::coral [static] |
const Color VRS::Color::cornflower_blue [static] |
const Color VRS::Color::cyan [static] |
const Color VRS::Color::dk_brown [static] |
const Color VRS::Color::dk_gray [static] |
const Color VRS::Color::dk_green [static] |
const Color VRS::Color::dk_olive_green [static] |
const Color VRS::Color::dk_orchid [static] |
const Color VRS::Color::dk_plum [static] |
const Color VRS::Color::dk_slate_blue [static] |
const Color VRS::Color::dk_slate_gray [static] |
const Color VRS::Color::dk_tan [static] |
const Color VRS::Color::dk_turquoise [static] |
const Color VRS::Color::dim_brown [static] |
const Color VRS::Color::dim_gray [static] |
const Color VRS::Color::firebrick [static] |
const Color VRS::Color::forest_green [static] |
const Color VRS::Color::gold [static] |
const Color VRS::Color::goldenrod [static] |
const Color VRS::Color::gray [static] |
const Color VRS::Color::green [static] |
const Color VRS::Color::green_yellow [static] |
const Color VRS::Color::grey [static] |
const Color VRS::Color::indian_red [static] |
const Color VRS::Color::khaki [static] |
const Color VRS::Color::lt_blue [static] |
const Color VRS::Color::lt_gray [static] |
const Color VRS::Color::lt_sky_blue [static] |
const Color VRS::Color::lt_steel_blue [static] |
const Color VRS::Color::lime_green [static] |
const Color VRS::Color::magenta [static] |
const Color VRS::Color::maroon [static] |
const Color VRS::Color::med_aquamarine [static] |
const Color VRS::Color::med_blue [static] |
const Color VRS::Color::med_brown [static] |
const Color VRS::Color::med_forest_green [static] |
const Color VRS::Color::med_goldenrod [static] |
const Color VRS::Color::med_gray [static] |
const Color VRS::Color::med_grey [static] |
const Color VRS::Color::med_orchid [static] |
const Color VRS::Color::med_plum [static] |
const Color VRS::Color::med_sea_green [static] |
const Color VRS::Color::med_slate_blue [static] |
const Color VRS::Color::med_spring_green [static] |
const Color VRS::Color::med_turquoise [static] |
const Color VRS::Color::med_violet_red [static] |
const Color VRS::Color::midnight_blue [static] |
const Color VRS::Color::navy [static] |
const Color VRS::Color::navy_blue [static] |
const Color VRS::Color::orange [static] |
const Color VRS::Color::orange_red [static] |
const Color VRS::Color::orchid [static] |
const Color VRS::Color::pale_green [static] |
const Color VRS::Color::pink [static] |
const Color VRS::Color::plum [static] |
const Color VRS::Color::red [static] |
const Color VRS::Color::salmon [static] |
const Color VRS::Color::sea_green [static] |
const Color VRS::Color::sienna [static] |
const Color VRS::Color::silver [static] |
const Color VRS::Color::sky_blue [static] |
const Color VRS::Color::slate_blue [static] |
const Color VRS::Color::slate_gray [static] |
const Color VRS::Color::spring_green [static] |
const Color VRS::Color::steel_blue [static] |
const Color VRS::Color::med_tan [static] |
const Color VRS::Color::thistle [static] |
const Color VRS::Color::turquoise [static] |
const Color VRS::Color::violet [static] |
const Color VRS::Color::violet_red [static] |
const Color VRS::Color::wheat [static] |
const Color VRS::Color::white [static] |
const Color VRS::Color::yellow [static] |
const Color VRS::Color::yellow_green [static] |