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.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/colour.cc (limited to 'src/colour.cc') diff --git a/src/colour.cc b/src/colour.cc new file mode 100644 index 0000000..e9df340 --- /dev/null +++ b/src/colour.cc @@ -0,0 +1,15 @@ +#include "colour.hh" + +#include + +Colour::Colour() : argb(0) {} + +Colour::Colour(uint32_t argb) : argb(argb) {} + +Colour::Colour(uint8_t r, uint8_t g, uint8_t b) + : argb(0xff000000 | (static_cast(r) << 16) | + (static_cast(g) << 8) | b) {} + +Colour::Colour(uint8_t a, uint8_t r, uint8_t g, uint8_t b) + : argb((static_cast(a) << 24) | (static_cast(r) << 16) | + (static_cast(g) << 8) | b) {} -- cgit v1.2.3-70-g09d2