app/
theme.rs

1use edtui::{EditorStatusLine, EditorTheme};
2use ratatui::{
3    prelude::Alignment,
4    style::{Color, Style},
5    widgets::{Block, BorderType, Borders},
6};
7
8#[derive(Default)]
9pub struct Theme<'a> {
10    pub editor: EditorTheme<'a>,
11}
12
13impl<'a> Theme<'a> {
14    pub fn new() -> Self {
15        Self {
16            editor: EditorTheme::default()
17                .block(
18                    Block::default()
19                        .borders(Borders::ALL)
20                        .border_type(BorderType::Thick)
21                        .title("|Editor|")
22                        .title_alignment(Alignment::Center),
23                )
24                .base(Style::default().bg(DARK_NIGHT).fg(WHITE))
25                .cursor_style(Style::default().bg(WHITE).fg(DARK_NIGHT))
26                .selection_style(Style::default().bg(ORANGE).fg(DARK_NIGHT))
27                .status_line(
28                    EditorStatusLine::default()
29                        .style_text(Style::default().fg(DARK_NIGHT).bg(GREEN))
30                        .style_line(Style::default().fg(WHITE).bg(DARK_GRAY))
31                        .align_left(true),
32                ),
33        }
34    }
35}
36
37pub(crate) const DARK_GRAY: Color = Color::Rgb(16, 17, 22);
38pub(crate) const WHITE: Color = Color::Rgb(248, 250, 252);
39pub(crate) const DARK_NIGHT: Color = Color::Rgb(16, 17, 22);
40pub(crate) const ORANGE: Color = Color::Rgb(255, 153, 0);
41pub(crate) const GREEN: Color = Color::Rgb(0, 204, 102);