From 55d29d0df8681efe01e88e0475c8512c44ec4bc4 Mon Sep 17 00:00:00 2001 From: A404M Date: Tue, 24 Dec 2024 01:23:24 +0330 Subject: fixed some bugs --- src/ui/color.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ui/color.h') 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, -- cgit v1.2.3