summaryrefslogtreecommitdiff
path: root/src/ui/color.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/color.h')
-rw-r--r--src/ui/color.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ui/color.h b/src/ui/color.h
new file mode 100644
index 0000000..43005a6
--- /dev/null
+++ b/src/ui/color.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <stdint.h>
+
+typedef struct COLOR {
+ uint8_t b, g, r, a;
+} COLOR;
+
+#define color_hex(value) \
+ (uint8_t)((uint32_t)value >> 3), \
+ (uint8_t)((uint32_t)value >> 2), \
+ (uint8_t)((uint32_t)value >> 1), \
+ (uint8_t)((uint32_t)value >> 0) \
+
+constexpr COLOR COLOR_NO_COLOR = {
+ .a = 0,
+ .r = 0,
+ .g = 0,
+ .b = 0,
+};
+
+
+extern COLOR color_init(uint32_t value);
+
+extern bool color_equals(COLOR a,COLOR b);
+extern bool color_not_equals(COLOR a,COLOR b);