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.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/color.h b/src/ui/color.h
index 43005a6..75df571 100644
--- a/src/ui/color.h
+++ b/src/ui/color.h
@@ -6,11 +6,12 @@ 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) \
+#define color_hex(value) { \
+ (uint8_t)(((uint32_t)value >> 8*0)&0xFF), \
+ (uint8_t)(((uint32_t)value >> 8*1)&0xFF), \
+ (uint8_t)(((uint32_t)value >> 8*2)&0xFF), \
+ (uint8_t)(((uint32_t)value >> 8*3)&0xFF), \
+}
constexpr COLOR COLOR_NO_COLOR = {
.a = 0,