diff options
author | Akshay <[email protected]> | 2020-02-10 15:29:14 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-02-10 15:29:14 +0000 |
commit | 743733f126d52b96cf5ea9332eb15886d581514e (patch) | |
tree | 6b2253baf6a08a408c856056caf82b28aa4f9535 /src/theme.rs | |
parent | d33e960c57fda3fa1c916ad765e32a673524d55e (diff) |
refactor out themes
Diffstat (limited to 'src/theme.rs')
-rw-r--r-- | src/theme.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/theme.rs b/src/theme.rs new file mode 100644 index 0000000..5c4072b --- /dev/null +++ b/src/theme.rs | |||
@@ -0,0 +1,26 @@ | |||
1 | use cursive::theme::Color::*; | ||
2 | use cursive::theme::PaletteColor::*; | ||
3 | use cursive::theme::{BaseColor, BorderStyle, Palette, Theme}; | ||
4 | |||
5 | pub fn pallete_gen() -> Palette { | ||
6 | let mut p = Palette::default(); | ||
7 | p[Background] = Dark(BaseColor::Black); | ||
8 | p[Shadow] = Light(BaseColor::Black); | ||
9 | p[View] = Dark(BaseColor::Black); | ||
10 | p[Primary] = Dark(BaseColor::White); | ||
11 | p[Secondary] = Light(BaseColor::Black); | ||
12 | p[Tertiary] = Dark(BaseColor::Green); | ||
13 | p[TitlePrimary] = Light(BaseColor::White); | ||
14 | p[Highlight] = Dark(BaseColor::Red); | ||
15 | p[HighlightInactive] = Dark(BaseColor::Black); | ||
16 | |||
17 | return p; | ||
18 | } | ||
19 | |||
20 | pub fn theme_gen() -> Theme { | ||
21 | let mut t = Theme::default(); | ||
22 | t.shadow = false; | ||
23 | t.borders = BorderStyle::Simple; | ||
24 | t.palette = pallete_gen(); | ||
25 | return t; | ||
26 | } | ||