aboutsummaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui.h b/ui.h
index 41ef975..ee434fc 100644
--- a/ui.h
+++ b/ui.h
@@ -50,12 +50,27 @@ enum UiStyle {
UI_STYLE_MAX,
};
+#if CONFIG_CURSES
typedef uint64_t CellAttr;
typedef short CellColor;
static inline bool cell_color_equal(CellColor c1, CellColor c2) {
return c1 == c2;
}
+#else
+typedef uint8_t CellAttr;
+typedef struct {
+ uint8_t r, g, b;
+ uint8_t index;
+} CellColor;
+
+static inline bool cell_color_equal(CellColor c1, CellColor c2) {
+ if (c1.index != (uint8_t)-1 || c2.index != (uint8_t)-1)
+ return c1.index == c2.index;
+ return c1.r == c2.r && c1.g == c2.g && c1.b == c2.b;
+}
+
+#endif
typedef struct {
CellAttr attr;