summaryrefslogtreecommitdiff
path: root/src/colour.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-01-02 22:42:31 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-01-02 22:42:31 +0100
commit6ed8f5151719fbc14ec0ac6d28a346d1f74cf2ca (patch)
treeebe7588e89e1aa2ae5376acf85f3a3a7b2ec7e10 /src/colour.hh
Initial commitHEADmain
Diffstat (limited to 'src/colour.hh')
-rw-r--r--src/colour.hh20
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