summaryrefslogtreecommitdiff
path: root/src/ui/color.c
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.c
Initial commit
Borrowing the app skeleton from Bitwise Harmony.
Diffstat (limited to 'src/ui/color.c')
-rw-r--r--src/ui/color.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/color.c b/src/ui/color.c
new file mode 100644
index 00000000..365bf986
--- /dev/null
+++ b/src/ui/color.c
@@ -0,0 +1,27 @@
1#include "color.h"
2
3static const iColor transparent_;
4
5iColor get_Color(int color) {
6 static const iColor palette[] = {
7 { 0, 0, 0, 255 },
8 { 40, 40, 40, 255 },
9 { 80, 80, 80, 255 },
10 { 160, 160, 160, 255 },
11 { 255, 255, 255, 255 },
12 { 106, 80, 0, 255 },
13 { 255, 192, 0, 255 },
14 { 0, 96, 128, 255 },
15 { 0, 192, 255, 255 },
16 { 255, 255, 32, 255 },
17 { 255, 64, 64, 255 },
18 { 255, 0, 255, 255 },
19 { 132, 132, 255, 255 },
20 { 0, 200, 0, 255 },
21 };
22 const iColor *clr = &transparent_;
23 if (color >= 0 && color < (int) iElemCount(palette)) {
24 clr = &palette[color];
25 }
26 return *clr;
27}