#include <Color.hpp>
◆ Color() [1/3]
◆ Color() [2/3]
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 |
◆ Color() [3/3]
◆ 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.
◆ operator!=()
◆ operator==() [1/2]
◆ operator==() [2/2]
template<typename T >
bool tson::Color< T >::operator== |
( |
const std::string & |
rhs | ) |
const |
|
inline |
The documentation for this class was generated from the following file:
- /home/robin/git/c++/tileson/include/objects/Color.hpp