From def2c3bf7a8d8ff251e97bf71422893cb4f0d9c3 Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Sun, 10 Oct 2021 23:18:25 +0800 Subject: [PATCH] graphics: refactor Color to a standalone file --- graphics/color.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 graphics/color.h diff --git a/graphics/color.h b/graphics/color.h new file mode 100644 index 0000000..8bcf3f2 --- /dev/null +++ b/graphics/color.h @@ -0,0 +1,30 @@ +#pragma once + +#include "../main.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +// HelosGraphics_Color is in ARGB little-endian packed format +// (B,G,R,A in byte order) +typedef struct { + uint8_t B, G, R; + uint8_t A; +} PACKED HelosGraphics_Color; + +extern const HelosGraphics_Color + HelosGraphics_Color_Black, + HelosGraphics_Color_White, + HelosGraphics_Color_Red, + HelosGraphics_Color_Green, + HelosGraphics_Color_Blue, + HelosGraphics_Color_Cyan, + HelosGraphics_Color_Magenta, + HelosGraphics_Color_Yellow; + + +#ifdef __cplusplus +} +#endif