#include <glv_color.h>
Public Member Functions | |
Color (float r, float g, float b, float a=1.f) | |
Color (float gray=1.f, float a=1.f) | |
Color & | operator= (const HSV &hsv) |
Set color from HSV values. | |
Color & | operator*= (float v) |
Multiply RGBA values by argument. | |
Color | operator* (float v) const |
Multiplies RGBA components by argument. | |
Color | operator+ (const Color &c) const |
Adds argument RGBA components. | |
Color | operator- (const Color &c) const |
Subtracts argument RGBA components. | |
Color | blackAndWhite () const |
Returns nearest black or white color. | |
Color | inverse () const |
Returns inverted color. | |
float | luminance () const |
Get luminance value. | |
void | clamp () |
Clamp RGB components into [0,1]. | |
void | invert () |
Invert colors. | |
void | scale (float amount) |
Scale RGB components. | |
void | set (float r, float g, float b, float a) |
Set RGBA components. | |
void | set (float r, float g, float b) |
Set RGB components. | |
void | set (const Color &other, float rgbScale=1) |
Copy another Color's colors. | |
void | set (float gray) |
Set as gray color. | |
void | set (float gray, float alpha) |
Set as gray color with alpha. | |
void | setHSV (float h, float s, float v) |
Set color from HSV values in [0, 1]. | |
void | getHSV (float &h, float &s, float &v) const |
Get HSV values in [0, 1] from color. | |
void | setHSV6 (float h, float s, float v) |
Set color from H value in [0, 6] and SV values in [0, 1]. | |
void | getHSV6 (float &h, float &s, float &v) const |
Get H value in [0, 6] and SV values in [0, 1] from color. | |
Public Attributes | |
float | r |
Red component in [0, 1]. | |
float | g |
Green component in [0, 1]. | |
float | b |
Blue component in [0, 1]. | |
float | a |
Alpha component in [0, 1]. |
glv::Color::Color | ( | float | r, | |
float | g, | |||
float | b, | |||
float | a = 1.f | |||
) | [inline] |
[in] | r | red component |
[in] | g | green component |
[in] | b | blue component |
[in] | a | alpha component |
glv::Color::Color | ( | float | gray = 1.f , |
|
float | a = 1.f | |||
) | [inline] |
[in] | gray | red/green/blue components |
[in] | a | alpha component |