From 82d11b7d3e15d8175accf7579db1fbe528fc6583 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Wed, 16 Dec 2020 13:34:56 +0100 Subject: Add constant for default colours and selection tool --- src/colours.rs | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 src/colours.rs (limited to 'src/colours.rs') 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, + }, + } + } +} -- cgit v1.2.3-70-g09d2