1 module style;
2 
3 import bindbc.nuklear;
4 
5 enum theme { THEME_BLACK, THEME_WHITE, THEME_RED, THEME_BLUE, THEME_DARK }
6 
7 void
8 set_style(nk_context *ctx, theme theme)
9 {
10     nk_color[NK_COLOR_COUNT] table;
11     if (theme == theme.THEME_WHITE) {
12         table[NK_COLOR_TEXT] = nk_rgba(70, 70, 70, 255);
13         table[NK_COLOR_WINDOW] = nk_rgba(175, 175, 175, 255);
14         table[NK_COLOR_HEADER] = nk_rgba(175, 175, 175, 255);
15         table[NK_COLOR_BORDER] = nk_rgba(0, 0, 0, 255);
16         table[NK_COLOR_BUTTON] = nk_rgba(185, 185, 185, 255);
17         table[NK_COLOR_BUTTON_HOVER] = nk_rgba(170, 170, 170, 255);
18         table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(160, 160, 160, 255);
19         table[NK_COLOR_TOGGLE] = nk_rgba(150, 150, 150, 255);
20         table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(120, 120, 120, 255);
21         table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(175, 175, 175, 255);
22         table[NK_COLOR_SELECT] = nk_rgba(190, 190, 190, 255);
23         table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(175, 175, 175, 255);
24         table[NK_COLOR_SLIDER] = nk_rgba(190, 190, 190, 255);
25         table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(80, 80, 80, 255);
26         table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(70, 70, 70, 255);
27         table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(60, 60, 60, 255);
28         table[NK_COLOR_PROPERTY] = nk_rgba(175, 175, 175, 255);
29         table[NK_COLOR_EDIT] = nk_rgba(150, 150, 150, 255);
30         table[NK_COLOR_EDIT_CURSOR] = nk_rgba(0, 0, 0, 255);
31         table[NK_COLOR_COMBO] = nk_rgba(175, 175, 175, 255);
32         table[NK_COLOR_CHART] = nk_rgba(160, 160, 160, 255);
33         table[NK_COLOR_CHART_COLOR] = nk_rgba(45, 45, 45, 255);
34         table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba( 255, 0, 0, 255);
35         table[NK_COLOR_SCROLLBAR] = nk_rgba(180, 180, 180, 255);
36         table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(140, 140, 140, 255);
37         table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(150, 150, 150, 255);
38         table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(160, 160, 160, 255);
39         table[NK_COLOR_TAB_HEADER] = nk_rgba(180, 180, 180, 255);
40         nk_style_from_table(ctx, table.ptr);
41     } else if (theme == theme.THEME_RED) {
42         table[NK_COLOR_TEXT] = nk_rgba(190, 190, 190, 255);
43         table[NK_COLOR_WINDOW] = nk_rgba(30, 33, 40, 215);
44         table[NK_COLOR_HEADER] = nk_rgba(181, 45, 69, 220);
45         table[NK_COLOR_BORDER] = nk_rgba(51, 55, 67, 255);
46         table[NK_COLOR_BUTTON] = nk_rgba(181, 45, 69, 255);
47         table[NK_COLOR_BUTTON_HOVER] = nk_rgba(190, 50, 70, 255);
48         table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(195, 55, 75, 255);
49         table[NK_COLOR_TOGGLE] = nk_rgba(51, 55, 67, 255);
50         table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(45, 60, 60, 255);
51         table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(181, 45, 69, 255);
52         table[NK_COLOR_SELECT] = nk_rgba(51, 55, 67, 255);
53         table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(181, 45, 69, 255);
54         table[NK_COLOR_SLIDER] = nk_rgba(51, 55, 67, 255);
55         table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(181, 45, 69, 255);
56         table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(186, 50, 74, 255);
57         table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(191, 55, 79, 255);
58         table[NK_COLOR_PROPERTY] = nk_rgba(51, 55, 67, 255);
59         table[NK_COLOR_EDIT] = nk_rgba(51, 55, 67, 225);
60         table[NK_COLOR_EDIT_CURSOR] = nk_rgba(190, 190, 190, 255);
61         table[NK_COLOR_COMBO] = nk_rgba(51, 55, 67, 255);
62         table[NK_COLOR_CHART] = nk_rgba(51, 55, 67, 255);
63         table[NK_COLOR_CHART_COLOR] = nk_rgba(170, 40, 60, 255);
64         table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba( 255, 0, 0, 255);
65         table[NK_COLOR_SCROLLBAR] = nk_rgba(30, 33, 40, 255);
66         table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(64, 84, 95, 255);
67         table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(70, 90, 100, 255);
68         table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(75, 95, 105, 255);
69         table[NK_COLOR_TAB_HEADER] = nk_rgba(181, 45, 69, 220);
70         nk_style_from_table(ctx, table.ptr);
71     } else if (theme == theme.THEME_BLUE) {
72         table[NK_COLOR_TEXT] = nk_rgba(20, 20, 20, 255);
73         table[NK_COLOR_WINDOW] = nk_rgba(202, 212, 214, 215);
74         table[NK_COLOR_HEADER] = nk_rgba(137, 182, 224, 220);
75         table[NK_COLOR_BORDER] = nk_rgba(140, 159, 173, 255);
76         table[NK_COLOR_BUTTON] = nk_rgba(137, 182, 224, 255);
77         table[NK_COLOR_BUTTON_HOVER] = nk_rgba(142, 187, 229, 255);
78         table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(147, 192, 234, 255);
79         table[NK_COLOR_TOGGLE] = nk_rgba(177, 210, 210, 255);
80         table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(182, 215, 215, 255);
81         table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(137, 182, 224, 255);
82         table[NK_COLOR_SELECT] = nk_rgba(177, 210, 210, 255);
83         table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(137, 182, 224, 255);
84         table[NK_COLOR_SLIDER] = nk_rgba(177, 210, 210, 255);
85         table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(137, 182, 224, 245);
86         table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(142, 188, 229, 255);
87         table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(147, 193, 234, 255);
88         table[NK_COLOR_PROPERTY] = nk_rgba(210, 210, 210, 255);
89         table[NK_COLOR_EDIT] = nk_rgba(210, 210, 210, 225);
90         table[NK_COLOR_EDIT_CURSOR] = nk_rgba(20, 20, 20, 255);
91         table[NK_COLOR_COMBO] = nk_rgba(210, 210, 210, 255);
92         table[NK_COLOR_CHART] = nk_rgba(210, 210, 210, 255);
93         table[NK_COLOR_CHART_COLOR] = nk_rgba(137, 182, 224, 255);
94         table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba( 255, 0, 0, 255);
95         table[NK_COLOR_SCROLLBAR] = nk_rgba(190, 200, 200, 255);
96         table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(64, 84, 95, 255);
97         table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(70, 90, 100, 255);
98         table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(75, 95, 105, 255);
99         table[NK_COLOR_TAB_HEADER] = nk_rgba(156, 193, 220, 255);
100         nk_style_from_table(ctx, table.ptr);
101     } else if (theme == theme.THEME_DARK) {
102         table[NK_COLOR_TEXT] = nk_rgba(210, 210, 210, 255);
103         table[NK_COLOR_WINDOW] = nk_rgba(57, 67, 71, 215);
104         table[NK_COLOR_HEADER] = nk_rgba(51, 51, 56, 220);
105         table[NK_COLOR_BORDER] = nk_rgba(46, 46, 46, 255);
106         table[NK_COLOR_BUTTON] = nk_rgba(48, 83, 111, 255);
107         table[NK_COLOR_BUTTON_HOVER] = nk_rgba(58, 93, 121, 255);
108         table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(63, 98, 126, 255);
109         table[NK_COLOR_TOGGLE] = nk_rgba(50, 58, 61, 255);
110         table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(45, 53, 56, 255);
111         table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(48, 83, 111, 255);
112         table[NK_COLOR_SELECT] = nk_rgba(57, 67, 61, 255);
113         table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(48, 83, 111, 255);
114         table[NK_COLOR_SLIDER] = nk_rgba(50, 58, 61, 255);
115         table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(48, 83, 111, 245);
116         table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(53, 88, 116, 255);
117         table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(58, 93, 121, 255);
118         table[NK_COLOR_PROPERTY] = nk_rgba(50, 58, 61, 255);
119         table[NK_COLOR_EDIT] = nk_rgba(50, 58, 61, 225);
120         table[NK_COLOR_EDIT_CURSOR] = nk_rgba(210, 210, 210, 255);
121         table[NK_COLOR_COMBO] = nk_rgba(50, 58, 61, 255);
122         table[NK_COLOR_CHART] = nk_rgba(50, 58, 61, 255);
123         table[NK_COLOR_CHART_COLOR] = nk_rgba(48, 83, 111, 255);
124         table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba(255, 0, 0, 255);
125         table[NK_COLOR_SCROLLBAR] = nk_rgba(50, 58, 61, 255);
126         table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(48, 83, 111, 255);
127         table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(53, 88, 116, 255);
128         table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(58, 93, 121, 255);
129         table[NK_COLOR_TAB_HEADER] = nk_rgba(48, 83, 111, 255);
130         nk_style_from_table(ctx, table.ptr);
131     } else {
132         nk_style_default(ctx);
133     }
134 }