diff options
Diffstat (limited to 'src/colour.hh')
| -rw-r--r-- | src/colour.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/colour.hh b/src/colour.hh new file mode 100644 index 0000000..8362bb3 --- /dev/null +++ b/src/colour.hh @@ -0,0 +1,20 @@ +#ifndef COLOUR_HH +#define COLOUR_HH + +#include <cstdint> + +struct Colour { + Colour(); + explicit Colour(uint32_t argb); + Colour(uint8_t r, uint8_t g, uint8_t b); + Colour(uint8_t a, uint8_t r, uint8_t g, uint8_t b); + + uint8_t alpha() const { return argb >> 24; }; + uint8_t red() const { return (argb >> 16) & 0xff; }; + uint8_t green() const { return (argb >> 8) & 0xff; }; + uint8_t blue() const { return argb & 0xff; }; + + uint32_t argb; +}; + +#endif // COLOUR_HH |
