|
| Color (const std::string &color) |
|
| Color (T red, T green, T blue, T alpha) |
|
Color< float > | asFloat () |
|
Color< uint8_t > | asInt () |
|
bool | operator!= (const Color &rhs) const |
|
bool | operator== (const Color &rhs) const |
|
bool | operator== (const std::string &rhs) const |
|
|
void | parseHexString (const std::string &color) |
|
◆ Color()
template<typename T >
tson::Color< T >::Color |
( |
T |
red, |
|
|
T |
green, |
|
|
T |
blue, |
|
|
T |
alpha |
|
) |
| |
|
inline |
Create a new color in rgba (red, green, blue, alpha) format
- Template Parameters
-
T | the template type for each channel. Usually uint8_t (8-bit int) or float. |
- Parameters
-
red | Red channel |
green | Green channel |
blue | Blue channel |
alpha | Alpha channel |
◆ asFloat()
Gets the Color as a float. Only useful if the template related to the current color is NOT float
- Template Parameters
-
- Returns
- If the T type is float, the value will be returned as a copy of itself. Else: All values will be divided by 255 before returning.
◆ asInt()
Gets the Color as an 32-bit variable, where each channel is 8-bit. Only useful if the template related to the current color is NOT already 8-bit int
- Template Parameters
-
- Returns
- If the T type is float, the value of each channel will be multiplied by 255. Else: The value will be returned as a copy of itself.
The documentation for this class was generated from the following file: