14 constexpr Color(uint8_t
r, uint8_t
g, uint8_t
b)
15 : rgb_((
r << 16) | (
g << 8) |
b) {}
18 uint8_t
r()
const {
return (uint8_t)(rgb_ >> 16); }
20 uint8_t
g()
const {
return (uint8_t)(rgb_ >> 8); }
22 uint8_t
b()
const {
return (uint8_t)(rgb_ >> 0); }
Simple 24-bit RGB color value.
uint8_t r() const
Returns the red component.
uint8_t b() const
Returns the blue component.
constexpr Color(uint8_t r, uint8_t g, uint8_t b)
Creates a color from 8-bit RGB components.
uint8_t g() const
Returns the green component.
constexpr Color()
Creates black (0,0,0).