1use ratatui::style::{Color, Style};
4
5#[derive(Debug, Clone)]
7#[non_exhaustive]
8pub struct FlapTheme {
9 pub fg: Color,
10 pub bg: Color,
11 pub tile_bg: Color,
12 pub split_fg: Color,
13 pub border_fg: Color,
14}
15
16impl FlapTheme {
17 pub fn new() -> Self {
18 Self::default()
19 }
20
21 pub fn fg(mut self, color: Color) -> Self {
22 self.fg = color;
23 self
24 }
25
26 pub fn bg(mut self, color: Color) -> Self {
27 self.bg = color;
28 self
29 }
30
31 pub fn tile_bg(mut self, color: Color) -> Self {
32 self.tile_bg = color;
33 self
34 }
35
36 pub fn split_fg(mut self, color: Color) -> Self {
37 self.split_fg = color;
38 self
39 }
40
41 pub fn border_fg(mut self, color: Color) -> Self {
42 self.border_fg = color;
43 self
44 }
45
46 pub(crate) fn char_style(&self) -> Style {
47 Style::new().fg(self.fg).bg(self.tile_bg)
48 }
49
50 pub(crate) fn tile_style(&self) -> Style {
51 Style::new().bg(self.tile_bg)
52 }
53
54 pub(crate) fn split_style(&self) -> Style {
55 Style::new().fg(self.split_fg).bg(self.tile_bg)
56 }
57
58 pub(crate) fn border_style(&self) -> Style {
59 Style::new().fg(self.border_fg).bg(self.tile_bg)
60 }
61
62 pub(crate) fn board_style(&self) -> Style {
63 Style::new().bg(self.bg)
64 }
65}
66
67impl Default for FlapTheme {
68 fn default() -> Self {
69 Self {
70 fg: Color::White,
71 bg: Color::Black,
72 tile_bg: Color::DarkGray,
73 split_fg: Color::Gray,
74 border_fg: Color::Rgb(80, 80, 80),
75 }
76 }
77}