]> git.draconx.ca Git - rrace.git/blob - src/colour.h
Make colour macros more flexible.
[rrace.git] / src / colour.h
1 /*
2  * Colour definitions for slide puzzle game.
3  * Copyright © 2022 Nick Bowler
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  */
18
19 #ifndef RRACE_COLOUR_H_
20 #define RRACE_COLOUR_H_
21
22 enum { COLOUR_PRIMARY, COLOUR_DARK, COLOUR_LIGHT, COLOUR_MAX };
23
24 #ifndef COLOUR_SYSTEM
25 #  define COLOUR_SYSTEM X11
26 #endif
27
28 #define COLOUR_SYS_X11(r, g, b) "#"#r#g#b
29
30 #define COLOUR_SYS__(mode, c) COLOUR_SYS_##mode c
31 #define COLOUR_SYS_(mode, c) COLOUR_SYS__(mode, c)
32 #define COLOUR_SYS(c) COLOUR_SYS_(COLOUR_SYSTEM, c)
33
34 /* red */
35 #define COLOUR0_PRIMARY_RGB_ (8d, 2e, 28)
36 #define COLOUR0_LIGHT_RGB_   (a1, 48, 42)
37 #define COLOUR0_DARK_RGB_    (6a, 1b, 17)
38
39 #define COLOUR0_PRIMARY COLOUR_SYS(COLOUR0_PRIMARY_RGB_)
40 #define COLOUR0_LIGHT   COLOUR_SYS(COLOUR0_LIGHT_RGB_)
41 #define COLOUR0_DARK    COLOUR_SYS(COLOUR0_DARK_RGB_)
42
43 /* orange */
44 #define COLOUR1_PRIMARY_RGB_ (b4, 6e, 28)
45 #define COLOUR1_LIGHT_RGB_   (c7, 90, 4f)
46 #define COLOUR1_DARK_RGB_    (92, 4a, 16)
47
48 #define COLOUR1_PRIMARY COLOUR_SYS(COLOUR1_PRIMARY_RGB_)
49 #define COLOUR1_LIGHT   COLOUR_SYS(COLOUR1_LIGHT_RGB_)
50 #define COLOUR1_DARK    COLOUR_SYS(COLOUR1_DARK_RGB_)
51
52 /* yellow */
53 #define COLOUR2_PRIMARY_RGB_ (d8, b7, 40)
54 #define COLOUR2_LIGHT_RGB_   (e2, c6, 5d)
55 #define COLOUR2_DARK_RGB_    (c5, 9f, 39)
56
57 #define COLOUR2_PRIMARY COLOUR_SYS(COLOUR2_PRIMARY_RGB_)
58 #define COLOUR2_LIGHT   COLOUR_SYS(COLOUR2_LIGHT_RGB_)
59 #define COLOUR2_DARK    COLOUR_SYS(COLOUR2_DARK_RGB_)
60
61 /* green */
62 #define COLOUR3_PRIMARY_RGB_ (28, 64, 28)
63 #define COLOUR3_DARK_RGB_    (19, 47, 19)
64 #define COLOUR3_LIGHT_RGB_   (4e, 87, 4e)
65
66 #define COLOUR3_PRIMARY COLOUR_SYS(COLOUR3_PRIMARY_RGB_)
67 #define COLOUR3_LIGHT   COLOUR_SYS(COLOUR3_LIGHT_RGB_)
68 #define COLOUR3_DARK    COLOUR_SYS(COLOUR3_DARK_RGB_)
69
70 /* blue */
71 #define COLOUR4_PRIMARY_RGB_ (00, 34, 71)
72 #define COLOUR4_DARK_RGB_    (00, 1f, 4f)
73 #define COLOUR4_LIGHT_RGB_   (00, 52, 8b)
74
75 #define COLOUR4_PRIMARY COLOUR_SYS(COLOUR4_PRIMARY_RGB_)
76 #define COLOUR4_LIGHT   COLOUR_SYS(COLOUR4_LIGHT_RGB_)
77 #define COLOUR4_DARK    COLOUR_SYS(COLOUR4_DARK_RGB_)
78
79 /* white */
80 #define COLOUR5_PRIMARY_RGB_ (dc, dc, dc)
81 #define COLOUR5_LIGHT_RGB_   (ea, ea, ea)
82 #define COLOUR5_DARK_RGB_    (c0, c0, c0)
83
84 #define COLOUR5_PRIMARY COLOUR_SYS(COLOUR5_PRIMARY_RGB_)
85 #define COLOUR5_LIGHT   COLOUR_SYS(COLOUR5_LIGHT_RGB_)
86 #define COLOUR5_DARK    COLOUR_SYS(COLOUR5_DARK_RGB_)
87
88 #endif