aboutsummaryrefslogtreecommitdiff
path: root/src/theme.rs
blob: e373b7258859a11d5a1600762f4ca64983cd5939 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use cursive::theme::Color::*;
use cursive::theme::PaletteColor::*;
use cursive::theme::{BorderStyle, ColorStyle, Palette, Style, Theme};

pub fn pallete_gen() -> Palette {
    let mut p = Palette::default();
    p[Background] = TerminalDefault;
    p[Shadow] = TerminalDefault;
    p[View] = TerminalDefault;
    p[Primary] = TerminalDefault;
    p[Secondary] = TerminalDefault;
    p[Tertiary] = TerminalDefault;
    p[TitlePrimary] = TerminalDefault;
    p[Highlight] = TerminalDefault;
    p[HighlightInactive] = TerminalDefault;

    return p;
}

pub fn theme_gen() -> Theme {
    let mut t = Theme::default();
    t.shadow = false;
    t.borders = BorderStyle::None;
    t.palette = pallete_gen();
    return t;
}

pub fn cursor_gen(foreground: Style) -> Style {
    Style::from(ColorStyle::new(
        TerminalDefault,
        Light(cursive::theme::BaseColor::Blue),
    ))
    .combine(foreground)
}