JNGL
Easy to use cross-platform 2D game library
|
Object representing a RGB color. More...
#include <jngl/Color.hpp>
Public Member Functions | |
Color (unsigned char red, unsigned char green, unsigned char blue) | |
unsigned char | getRed () const |
0...255 | |
void | setRed (unsigned char) |
0...255 | |
unsigned char | getGreen () const |
0...255 | |
void | setGreen (unsigned char) |
0...255 | |
unsigned char | getBlue () const |
0...255 | |
void | setBlue (unsigned char) |
0...255 | |
operator Rgb () const | |
Implicit conversion for backwards compatibility. | |
Object representing a RGB color.
You can use the custom literal operator to create a jngl::Color from HTML color codes. For example #68da4f
becomes:
You can use this to quickly pass a HTML code to jngl::setColor. The following lines are equivalent:
Color | ( | unsigned char | red, |
unsigned char | green, | ||
unsigned char | blue ) |
red | 0...255 |
green | 0...255 |
blue | 0...255 |