aboutsummaryrefslogtreecommitdiff
path: root/src/colours.rs
diff options
context:
space:
mode:
authorArne Dußin2020-12-21 21:12:01 +0100
committerGitHub2020-12-21 21:12:01 +0100
commitc435f278eddcada279fdc424120e4a1448843c20 (patch)
treebe9a5601e99608966d4ccd146c3bfb3a70c7fc02 /src/colours.rs
parent3bc690803fb59493ea8180fd630d65b3e26642d0 (diff)
parent82d11b7d3e15d8175accf7579db1fbe528fc6583 (diff)
downloadgraf_karto-c435f278eddcada279fdc424120e4a1448843c20.tar.gz
graf_karto-c435f278eddcada279fdc424120e4a1448843c20.zip
Merge pull request #24 from LordSentox/refactor
Refactor to make interaction between tools easier
Diffstat (limited to 'src/colours.rs')
-rw-r--r--src/colours.rs86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/colours.rs b/src/colours.rs
new file mode 100644
index 0000000..8d69869
--- /dev/null
+++ b/src/colours.rs
@@ -0,0 +1,86 @@
+use raylib::ffi::Color;
+
+pub const DEFAULT_COLOURS: Colours = Colours::default();
+
+pub struct Colours {
+ pub deletion_rect: Color,
+ pub deletion_rect_outline: Color,
+ pub selection_rect: Color,
+ pub selection_rect_outline: Color,
+ pub room_normal: Color,
+ pub room_selected: Color,
+ pub wall_normal: Color,
+ pub wall_selected: Color,
+ pub icon_normal: Color,
+ pub icon_selected: 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,
+ },
+ }
+ }
+}