summaryrefslogtreecommitdiff
path: root/src/ui/color.h
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2024-12-24 01:23:24 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2024-12-24 01:23:24 +0330
commit55d29d0df8681efe01e88e0475c8512c44ec4bc4 (patch)
tree2b07ab80b17c8bb6b20837e104aa863854f7ccff /src/ui/color.h
parent217e7d18dbaa260a15f5612d9670105b04cd455f (diff)
fixed some bugs
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,