aboutsummaryrefslogtreecommitdiff
path: root/src/colours.rs
blob: 4a3b799816168d8e6164dcd991e9f0ce6c52bcbd (plain) (blame)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! The colour definitions used for items drawn in graf karto.

use raylib::ffi::Color;

/// Contains the default colours used throughout, if nothing else is set.
pub const DEFAULT_COLOURS: Colours = Colours::default();

/// All the different colours that may be used for different elements of the program. Contains one
/// entry for each colourable component.
pub struct Colours {
    /// Colour the rectangle used for the deletion tool is filled with.
    pub deletion_rect: Color,
    /// The colour of the outline of the deletion tool rectangle.
    pub deletion_rect_outline: Color,
    /// The colour that is used for filling the selection tool's rectangle.
    pub selection_rect: Color,
    /// Colour of the selection tool rectangle outline.
    pub selection_rect_outline: Color,
    /// Colour of the rooms that are currently not selected.
    pub room_normal: Color,
    /// The Colour the rooms should be tinted in when they have been selected.
    pub room_selected: Color,
    /// Colour of the walls when they are not selected.
    pub wall_normal: Color,
    /// Colour of the walls when they have been selected.
    pub wall_selected: Color,
    /// Colour of the icons when they are not selected.
    pub icon_normal: Color,
    /// Colour of the icons when they are selected.
    pub icon_selected: Color,
    /// Colour used to draw the rulers (the ruling lines) of the dimension indicator.
    pub dimension_indicators: Color,
    /// Colour of the text used to display the size of the dimension indicators dimensions.
    pub dimension_text: Color,
    /// The colour used for drawing the lines of the grid which divides the map into chunks of evenly
    /// spaced cells.
    pub grid_lines: Color,
}

impl Colours {
    // NOTE: Unfortunately the default function cannot be made const, since Default is a trait. This
    // feature is, as far as I can tell, planned in Rust, but not yet implemented. Once it is, Colours
    // should implement Default instead.
    const fn default() -> Self {
        Self {
            deletion_rect: Color {
                r: 200,
                g: 150,
                b: 150,
                a: 50,
            },
            deletion_rect_outline: Color {
                r: 200,
                g: 150,
                b: 150,
                a: 150,
            },
            selection_rect: Color {
                r: 255,
                g: 129,
                b: 0,
                a: 50,
            },
            selection_rect_outline: Color {
                r: 255,
                g: 129,
                b: 0,
                a: 150,
            },
            room_normal: Color {
                r: 180,
                g: 180,
                b: 180,
                a: 255,
            },
            room_selected: Color {
                r: 150,
                g: 200,
                b: 150,
                a: 255,
            },
            wall_normal: Color {
                r: 200,
                g: 120,
                b: 120,
                a: 255,
            },
            wall_selected: Color {
                r: 150,
                g: 200,
                b: 150,
                a: 255,
            },
            icon_normal: Color {
                r: 255,
                g: 255,
                b: 255,
                a: 255,
            },
            icon_selected: Color {
                r: 150,
                g: 200,
                b: 150,
                a: 255,
            },
            dimension_indicators: Color {
                r: 200,
                g: 200,
                b: 200,
                a: 255,
            },
            dimension_text: Color {
                r: 200,
                g: 200,
                b: 200,
                a: 255,
            },
            grid_lines: Color {
                r: 255,
                g: 255,
                b: 255,
                a: 75,
            },
        }
    }
}