From df7ff7a323a5e783f68f269a23d96b24d265f204 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sun, 9 Jul 2023 13:36:14 -0500 Subject: [PATCH] added: theme colors --- src/lib.rs | 10 ++++++++-- src/map.rs | 4 ++-- src/mask.rs | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index af6b704..628df32 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ use iced::{ theme::Theme, time, widget::{column, container, row, text, vertical_slider, vertical_space}, - window, Alignment, {Application, Command, Element, Length, Point, Subscription}, + window, Alignment, Color, {Application, Command, Element, Length, Point, Subscription}, }; use itertools::Itertools; @@ -281,6 +281,12 @@ impl Application for CellSeq { } fn theme(&self) -> Theme { - Theme::Dark + Theme::custom(iced::theme::Palette { + background: Color::from_rgb8(0x15, 0x15, 0x15), + text: Color::from_rgb8(0xD7, 0xD0, 0xC7), + primary: Color::from_rgb8(0x9B, 0x64, 0xFB), + success: Color::from_rgb8(0x42, 0x71, 0x7B), + danger: Color::from_rgb8(0xD2, 0x3D, 0x3D), + }) } } diff --git a/src/map.rs b/src/map.rs index 488a5c7..79da34b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -168,7 +168,7 @@ impl Program for Map { ) -> Vec { vec![self.life_cache.draw(bounds.size(), |frame| { let background = Path::rectangle(Point::ORIGIN, frame.size()); - frame.fill(&background, Color::from_rgb8(0x10, 0x10, 0x10)); + frame.fill(&background, Color::from_rgb8(0x30, 0x30, 0x30)); frame.with_save(|frame| { frame.scale(Cell::SIZE as f32); @@ -180,7 +180,7 @@ impl Program for Map { frame.fill_rectangle( Point::new(x.0 as f32, x.1 as f32), Size::UNIT, - Color::WHITE, + Color::from_rgb8(0xD7, 0xD0, 0xC7), ); }) }); diff --git a/src/mask.rs b/src/mask.rs index 191720e..0ff91ea 100644 --- a/src/mask.rs +++ b/src/mask.rs @@ -102,7 +102,7 @@ impl Program for Mask { ) -> Vec { vec![self.mask_cache.draw(bounds.size(), |frame| { let background = Path::rectangle(Point::ORIGIN, frame.size()); - frame.fill(&background, Color::from_rgb8(0x10, 0x10, 0x10)); + frame.fill(&background, Color::from_rgb8(0x30, 0x30, 0x30)); frame.with_save(|frame| { frame.scale(Cell::SIZE as f32); @@ -115,9 +115,9 @@ impl Program for Mask { Point::new(x.0 as f32, x.1 as f32), Size::UNIT, if self.hits.contains(&Cell { i: x.1, j: x.0 }) { - Color::from_rgb8(0xFF, 0xFF, 0xFF) + Color::from_rgb8(0x42, 0x71, 0x7B) } else { - Color::from_rgb8(0xDD, 0xDD, 0xDD) + Color::from_rgb8(0xD7, 0xD0, 0xC7) }, ); }) -- 2.45.2