18 Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) : r_(r), g_(g), b_(b), a_(a) {}
24 Color(uint8_t r, uint8_t g, uint8_t b) : r_(r), g_(g), b_(b), a_(255) {}
27 uint8_t
getRed()
const {
return r_; }
44 return (static_cast<uint32_t>(
getRed()) << 24) | (static_cast<uint32_t>(
getGreen()) << 16) |
45 (static_cast<uint32_t>(
getBlue()) << 8) | (static_cast<uint32_t>(
getAlpha()));
uint8_t getBlue() const
Returns the blue channel; value is between 0 and 255.
Definition: color.hpp:31
void setBlue(uint8_t b)
Definition: color.hpp:40
void setGreen(uint8_t g)
Definition: color.hpp:39
void setAlpha(uint8_t a)
Definition: color.hpp:41
uint32_t toInt() const
Definition: color.hpp:43
uint8_t getRed() const
Returns the red channel; value is between 0 and 255.
Definition: color.hpp:27
void setRed(uint8_t r)
Definition: color.hpp:38
Color()
Creates a color object with zero for the red, green, blue, and alpha channels.
Definition: color.hpp:12
uint8_t getAlpha() const
Definition: color.hpp:36
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Creates a color from the given red, green, blue, and alpha channel values.
Definition: color.hpp:18
uint8_t getGreen() const
Returns the green channel; value is between 0 and 255.
Definition: color.hpp:29
Structure to describe an RGB color.
Definition: color.hpp:8
Color(uint8_t r, uint8_t g, uint8_t b)
Creates a color from the given red, green, and blue values.
Definition: color.hpp:24