summaryrefslogtreecommitdiff
path: root/src/ui/color.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-21 15:06:52 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-21 15:07:38 +0300
commitd773b499e595a43b9b1ae449262dcf13cabf2d02 (patch)
treeb1baeb12025a04f8316636b5d0ab18e30ceedb2c /src/ui/color.h
Initial commit
Borrowing the app skeleton from Bitwise Harmony.
Diffstat (limited to 'src/ui/color.h')
-rw-r--r--src/ui/color.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/ui/color.h b/src/ui/color.h
new file mode 100644
index 00000000..f0244fc2
--- /dev/null
+++ b/src/ui/color.h
@@ -0,0 +1,48 @@
1#pragma once
2
3#include <the_Foundation/defs.h>
4
5enum iColorId {
6 none_ColorId = -1,
7 black_ColorId,
8 gray25_ColorId,
9 gray50_ColorId,
10 gray75_ColorId,
11 white_ColorId,
12 brown_ColorId,
13 orange_ColorId,
14 teal_ColorId,
15 cyan_ColorId,
16 yellow_ColorId,
17 red_ColorId,
18 magenta_ColorId,
19 blue_ColorId,
20 green_ColorId,
21 max_ColorId
22};
23
24#define mask_ColorId 0x0f
25#define permanent_ColorId 0x80 /* cannot be changed via escapes */
26
27#define black_ColorEscape "\r0"
28#define gray25_ColorEscape "\r1"
29#define gray50_ColorEscape "\r2"
30#define gray75_ColorEscape "\r3"
31#define white_ColorEscape "\r4"
32#define brown_ColorEscape "\r5"
33#define orange_ColorEscape "\r6"
34#define teal_ColorEscape "\r7"
35#define cyan_ColorEscape "\r8"
36#define yellow_ColorEscape "\r9"
37#define red_ColorEscape "\r:"
38#define magenta_ColorEscape "\r;"
39#define blue_ColorEscape "\r<"
40#define green_ColorEscape "\r="
41
42iDeclareType(Color)
43
44struct Impl_Color {
45 uint8_t r, g, b, a;
46};
47
48iColor get_Color (int color);