aboutsummaryrefslogtreecommitdiff
path: root/src/theme.rs
blob: 17db722938d23bf0e3814975b8d30e402c9a1e22 (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use ratatui::style::{Color, Modifier, Style};

pub struct Theme;

impl Theme {
    pub const BG: Color = Color::Rgb(30, 30, 46);

    pub const PRIMARY: Color = Color::Rgb(139, 92, 246);
    pub const SECONDARY: Color = Color::Rgb(196, 181, 253);

    pub const SUCCESS: Color = Color::Rgb(34, 197, 94);

    pub const WARNING: Color = Color::Rgb(245, 158, 11);
    pub const ERROR: Color = Color::Rgb(239, 68, 68);

    pub const TEXT: Color = Color::Rgb(226, 232, 240);
    pub const MUTED: Color = Color::Rgb(148, 163, 184);

    pub const INFO: Color = Color::Rgb(56, 189, 248);

    pub fn primary() -> Style {
        Style::default().fg(Self::PRIMARY)
    }

    pub fn secondary() -> Style {
        Style::default().fg(Self::SECONDARY)
    }

    pub fn block() -> Style {
        Style::default().fg(Self::PRIMARY).bg(Self::BG)
    }

    pub fn text() -> Style {
        Style::default().fg(Self::TEXT)
    }

    pub fn muted() -> Style {
        Style::default().fg(Self::MUTED)
    }

    pub fn title() -> Style {
        Style::default()
            .fg(Self::SECONDARY)
            .add_modifier(Modifier::BOLD)
    }

    pub fn selected() -> Style {
        Style::default()
            .bg(Self::PRIMARY)
            .fg(Self::TEXT)
            .add_modifier(Modifier::BOLD)
    }

    pub fn success() -> Style {
        Style::default().fg(Self::SUCCESS)
    }

    pub fn warning() -> Style {
        Style::default().fg(Self::WARNING)
    }

    pub fn error() -> Style {
        Style::default().fg(Self::ERROR)
    }

    pub fn info() -> Style {
        Style::default().fg(Self::INFO)
    }
}