|
Public Member Functions |
| Color () |
| Color (const Color &c) |
| Color (const float r, const float g, const float b, const float a=1.0) |
| Color (str_ptr colstr) |
virtual | ~Color () |
void | set (const float r, const float g, const float b, const float a=1.0) |
void | set (str_ptr colstr) |
| can call this with a CONFIGval, for example
|
float | r () const |
float | g () const |
float | b () const |
float | a () const |
void | setHLS (const float h, const float l, const float s, const float a=1.0) |
| set the color in HLS mode: "h" (hue 0.0-360.0), "l" (lightness 0.0-1.0), and "s" (saturation 0.0-1.0)
|
void | getHLS (float &h, float &l, float &s) |
| get color in HLS mode: "h" (hue 0.0-360.0), "l" (lightness 0.0-1.0), and "s" (saturation 0.0-1.0)
|
bool | setLAB (const float L, const float a, const float b, const float alpha=1.0) |
| Set the color in LAB mode--if LAB is invalid, closest rgb color is set and false returned; else, true returned.
|
void | getLAB (float &L, float &a, float &b) |
| get the color in LAB mode: "L" (lightness), "a" (green to red), and "b" (blue to yellow)
|
void | getXYZ (float &X, float &Y, float &Z) |
| get the color in CIEXYZ mode
|
void | LABtoXYZ (const float L, const float A, const float B, float &X, float &Y, float &Z) |
| convert from LAB mode to XYZ mode
|
float * | array () |
bool | operator== (const Color &c) const |
float | operator[] (const int index) const |
float & | operator[] (const int index) |
Static Public Member Functions |
float | getLABChroma (const float L, const float a, const float b) |
| get the chroma (0.0-100.0), assumes valid LAB values
|
float | getLABSaturation (const float L, const float a, const float b) |
| get the saturation (0.0-100.0), assumes valid LAB values
|
float | getLABHue (const float L, const float a, const float b) |
| get the hue angle (0.0-360.0), assumes valid LAB values -- note: does not correspond to 'H' in HLS
|
void | setLABLightnessChromaHue (const float L, float &a, float &b, const float chroma, const float hue) |
| the following four functions set LAB values, to actually set the RGB value, setLAB() needs to be called
|
void | setLABChromaSaturationHue (float &L, float &a, float &b, const float chroma, const float saturation, const float hue) |
void | setLABLightnessSaturationHue (const float L, float &a, float &b, const float saturation, const float hue) |
void | setLABSaturationAB (float &L, const float a, const float b, const float saturation) |
float | getLABColorDifference (const float L1, const float a1, const float b1, const float L2, const float a2, const float b2) |
| returns the a value of difference in color
|
bool | findMaxL_LAB (float &L, const float a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
| the following functions find the max/min for a particular value when the other two values are constant
|
bool | findMinL_LAB (float &L, const float a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxA_LAB (const float L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinA_LAB (const float L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxB_LAB (const float L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinB_LAB (const float L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxL_LA_LAB (float &L, float &a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinL_LA_LAB (float &L, float &a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxA_LA_LAB (float &L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinA_LA_LAB (float &L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxL_LB_LAB (float &L, const float a, float &b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinL_LB_LAB (float &L, const float a, float &b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxB_LB_LAB (float &L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinB_LB_LAB (float &L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxA_AB_LAB (const float L, float &a, float &b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinA_AB_LAB (const float L, float &a, float &b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMaxB_AB_LAB (const float L, float &a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
bool | findMinB_AB_LAB (const float L, float &a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false) |
Static Public Attributes |
const Color | black |
const Color | white |
const Color | grey |
const Color | red |
const Color | green |
const Color | yellow |
const Color | blue |
const Color | magenta |
const Color | cyan |
const Color | pink |
const Color | brown |
const Color | tan |
const Color | orange |
const Color | firebrick |
const double | RGBtoXYZarray [3][3] |
const double | XYZtoRGBarray [3][3] |
Static Protected Member Functions |
double | value (double n1, double n2, double hue) |
| helps the HLS conversion
|
double | Labf (const double ratio) |
| These help the LAB conversion.
|
double | Labfinv (const double ratio) |
Protected Attributes |
float | _col [4] |