Skip to main content

apiari_tui/
theme.rs

1#![allow(dead_code)]
2
3use ratatui::style::{Color, Modifier, Style};
4
5// ── Color Palette ──────────────────────────────────────────
6// Warm honey / amber tones for the bee theme.
7// Pops against dark terminal backgrounds.
8
9pub const HONEY: Color = Color::Rgb(255, 183, 77); // warm amber
10pub const GOLD: Color = Color::Rgb(255, 215, 0); // bright gold
11pub const NECTAR: Color = Color::Rgb(255, 138, 61); // deep orange
12pub const POLLEN: Color = Color::Rgb(250, 230, 140); // soft yellow
13pub const WAX: Color = Color::Rgb(60, 56, 48); // dark warm gray
14pub const COMB: Color = Color::Rgb(40, 37, 32); // darker bg
15pub const SMOKE: Color = Color::Rgb(140, 135, 125); // muted text
16pub const ROYAL: Color = Color::Rgb(160, 120, 255); // purple accent
17pub const MINT: Color = Color::Rgb(100, 230, 180); // green/success
18pub const EMBER: Color = Color::Rgb(255, 90, 90); // red/error
19pub const FROST: Color = Color::Rgb(220, 220, 225); // bright text
20pub const SLATE: Color = Color::Rgb(140, 145, 155); // cool gray for headers
21pub const STEEL: Color = Color::Rgb(100, 105, 115); // medium cool gray for borders
22pub const ICE: Color = Color::Rgb(175, 180, 190); // light cool gray for labels
23pub const HEADER_BG: Color = Color::Rgb(65, 60, 52); // section header bar bg (visible against terminal)
24pub const FOCUS_BG: Color = Color::Rgb(55, 47, 37); // warm tint for focused panel headers
25pub const TOOL_FOCUS_BG: Color = Color::Rgb(50, 47, 42); // subtle tint for focused tool entry
26pub const OVERLAY_BG: Color = Color::Rgb(30, 28, 25); // dark overlay background
27
28// ── Styles ─────────────────────────────────────────────────
29
30pub fn title() -> Style {
31    Style::default().fg(HONEY).add_modifier(Modifier::BOLD)
32}
33
34pub fn subtitle() -> Style {
35    Style::default().fg(SMOKE)
36}
37
38pub fn text() -> Style {
39    Style::default().fg(FROST)
40}
41
42pub fn muted() -> Style {
43    Style::default().fg(SMOKE)
44}
45
46pub fn accent() -> Style {
47    Style::default().fg(HONEY)
48}
49
50pub fn highlight() -> Style {
51    Style::default()
52        .fg(COMB)
53        .bg(HONEY)
54        .add_modifier(Modifier::BOLD)
55}
56
57pub fn selected() -> Style {
58    Style::default().fg(GOLD).add_modifier(Modifier::BOLD)
59}
60
61pub fn success() -> Style {
62    Style::default().fg(MINT)
63}
64
65pub fn error() -> Style {
66    Style::default().fg(EMBER)
67}
68
69pub fn agent_color() -> Style {
70    Style::default().fg(ROYAL)
71}
72
73pub fn key_hint() -> Style {
74    Style::default().fg(HONEY).add_modifier(Modifier::BOLD)
75}
76
77pub fn key_desc() -> Style {
78    Style::default().fg(SMOKE)
79}
80
81pub fn border() -> Style {
82    Style::default().fg(WAX)
83}
84
85pub fn border_active() -> Style {
86    Style::default().fg(HONEY)
87}
88
89pub fn tool_name() -> Style {
90    Style::default().fg(ICE).add_modifier(Modifier::BOLD)
91}
92
93pub fn border_neutral() -> Style {
94    Style::default().fg(STEEL)
95}
96
97pub fn input_cursor() -> Style {
98    Style::default().fg(GOLD).add_modifier(Modifier::BOLD)
99}
100
101pub fn status_running() -> Style {
102    Style::default().fg(MINT)
103}
104
105pub fn status_idle() -> Style {
106    Style::default().fg(SMOKE)
107}
108
109pub fn status_done() -> Style {
110    Style::default().fg(POLLEN)
111}
112
113pub fn logo() -> Style {
114    Style::default().fg(HONEY).add_modifier(Modifier::BOLD)
115}
116
117pub fn overlay_bg() -> Style {
118    Style::default().bg(OVERLAY_BG)
119}
120
121pub fn status_waiting() -> Style {
122    Style::default().fg(HONEY)
123}
124
125pub fn status_dead() -> Style {
126    Style::default().fg(EMBER)
127}
128
129pub fn status_pending() -> Style {
130    Style::default().fg(POLLEN)
131}
132
133pub fn severity_critical() -> Style {
134    Style::default().fg(EMBER).add_modifier(Modifier::BOLD)
135}
136
137pub fn severity_warning() -> Style {
138    Style::default().fg(NECTAR)
139}
140
141pub fn severity_info() -> Style {
142    Style::default().fg(SMOKE)
143}
144
145pub fn pr_open() -> Style {
146    Style::default().fg(MINT)
147}
148
149pub fn pr_merged() -> Style {
150    Style::default().fg(ROYAL)
151}
152
153pub fn pr_closed() -> Style {
154    Style::default().fg(EMBER)
155}
156
157pub fn divider() -> Style {
158    Style::default().fg(WAX)
159}
160
161/// Bright sidebar colors for the left bar indicator.
162pub const SIDEBAR_COLORS: &[Color] = &[
163    Color::Rgb(180, 120, 60), // warm brown
164    Color::Rgb(60, 120, 180), // cool blue
165    Color::Rgb(60, 180, 60),  // forest green
166    Color::Rgb(140, 60, 180), // purple
167    Color::Rgb(60, 180, 180), // teal
168    Color::Rgb(180, 150, 60), // amber
169    Color::Rgb(180, 60, 120), // rose
170    Color::Rgb(100, 180, 60), // olive
171];