1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#pragma once
#include <al/types.h>
#include <al/str.h>
#include <nnwt/file.h>
enum {
CAMU_COLOR_BACKGROUND = 0,
CAMU_COLOR_FOREGROUND,
CAMU_COLOR0,
CAMU_COLOR1,
CAMU_COLOR2,
CAMU_COLOR3,
CAMU_COLOR4,
CAMU_COLOR5,
CAMU_COLOR6,
CAMU_COLOR7,
CAMU_COLOR8,
CAMU_COLOR9,
CAMU_COLOR10,
CAMU_COLOR11,
CAMU_COLOR12,
CAMU_COLOR13,
CAMU_COLOR14,
CAMU_COLOR15
};
#define CAMU_COLOR_PALETTE_COUNT 18
struct camu_color_palette {
u32 colors[CAMU_COLOR_PALETTE_COUNT];
};
extern struct camu_color_palette global_color_palette;
bool camu_colors_maybe_init(str *path);
static inline void camu_colors_default_init()
{
char *home_env = getenv("HOME");
if (home_env) {
str color_palette;
al_str_from(&color_palette, home_env);
nn_path_append(&color_palette, &al_str_c(".config"));
nn_path_append(&color_palette, &al_str_c("colors.json"));
camu_colors_maybe_init(&color_palette);
al_str_free(&color_palette);
}
}
|