From a1e4769c34219e28ec489159f01491dbffc929eb Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Thu, 5 Jul 2018 19:24:28 +0530 Subject: Refactor into theme.rs --- src/theme.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/theme.rs diff --git a/src/theme.rs b/src/theme.rs new file mode 100644 index 0000000..f091358 --- /dev/null +++ b/src/theme.rs @@ -0,0 +1,31 @@ +use cursive::theme::Color::*; +use cursive::theme::BaseColor::*; +use cursive::theme::BorderStyle; +use cursive::theme; + +pub fn palette_gen() -> theme::Palette { + let mut palette: theme::Palette = theme::Palette::default(); + + palette.set_color("background" , Dark(Black)); + palette.set_color("shadow" , Dark(White)); + palette.set_color("view" , Dark(Black)); + palette.set_color("primary" , Dark(White)); + palette.set_color("secondary" , Light(Black)); + palette.set_color("teritary" , Dark(Green)); + palette.set_color("title_primary" , Dark(Blue)); + palette.set_color("title_secondary" , Dark(Green)); + palette.set_color("highlight" , Dark(Blue)); + palette.set_color("highlight_inactive" , Light(Black)); + + palette +} + +pub fn theme_gen() -> theme::Theme { + let mut wikitheme = theme::load_default(); + + wikitheme.shadow = false; + wikitheme.borders = BorderStyle::Simple; + wikitheme.palette = palette_gen(); + + wikitheme +} -- cgit v1.2.3