From 6ed8f5151719fbc14ec0ac6d28a346d1f74cf2ca Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Fri, 2 Jan 2026 22:42:31 +0100 Subject: Initial commit --- src/colour.hh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/colour.hh (limited to 'src/colour.hh') 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 + +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 -- cgit v1.2.3-70-g09d2