|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiColors.h>
Inheritance diagram for lti::rgbColor:


Public Member Functions | |
| rgbColor () | |
| rgbColor (const uint32 val) | |
| rgbColor (const rgbPixel &other) | |
| rgbColor (const ubyte r, const ubyte g, const ubyte b, const ubyte d=0) | |
| bool | parseHTML (const std::string &s, bool acceptAlpha=false) |
| std::string | makeHTML (bool getAlpha=false) |
| bool | parseName (const std::string &s) |
It has several useful methods though that can be used for reading color definitions from external sources.
|
|
default constructor
|
|
|
constructor with member initialization Per default a new rgbColor will be initialized with the given value.
|
|
|
Upgrade constructor.
|
|
||||||||||||||||||||
|
rgb constructor
|
|
|
Returns a HTML color definition of this color.
|
|
||||||||||||
|
Parses a HTML color definition string and sets this color to the given one. In HTML, RGB colors are defined by the following syntax:
Color = RRGGBB
RR = ( 0 | 1 | 2 | ... | 9 | a | A | b | B | ... | f | F ){2}
GG = ( 0 | 1 | 2 | ... | 9 | a | A | b | B | ... | f | F ){2}
BB = ( 0 | 1 | 2 | ... | 9 | a | A | b | B | ... | f | F ){2}
For instance, "#ff0000" means red (r=255,g=0,b=0). This method also can accept an extension which also includes the alpha value as a fourth component (Color = RRGGBBAA). If the component is not present, it will be assumed zero. If a string cannot be parsed, the value of this color object will be undefined.
|
|
|
Parses a color name (which colors are defined, is system dependent) and sets this color to the giveon one. If the color name is undefined, the method will return false;
|