Skip to content

Commit 9528eab

Browse files
committed
use consts for colors
1 parent 0efe4b3 commit 9528eab

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

crates/chat-cli/src/theme/colors.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
33
use crossterm::style::Color;
44

5+
// ANSI color value constants
6+
/// Purple brand color
7+
pub const BRAND_PURPLE: u8 = 141;
8+
/// Light grey for primary text
9+
pub const LIGHT_GREY: u8 = 252;
10+
/// Medium-light grey for secondary text
11+
pub const MEDIUM_LIGHT_GREY: u8 = 248;
12+
/// Bright magenta for emphasis and current items
13+
pub const BRIGHT_MAGENTA: u8 = 13;
14+
515
/// Colors for status messages and feedback
616
#[derive(Debug, Clone)]
717
pub struct StatusColors {
@@ -63,23 +73,22 @@ impl Default for StatusColors {
6373
impl Default for UiColors {
6474
fn default() -> Self {
6575
Self {
66-
primary_brand: Color::AnsiValue(141),
67-
68-
primary_text: Color::AnsiValue(252),
69-
secondary_text: Color::AnsiValue(248),
70-
emphasis: Color::AnsiValue(252),
71-
command_highlight: Color::AnsiValue(141),
72-
current_item: Color::AnsiValue(13),
76+
primary_brand: Color::AnsiValue(BRAND_PURPLE),
77+
primary_text: Color::AnsiValue(LIGHT_GREY),
78+
secondary_text: Color::AnsiValue(MEDIUM_LIGHT_GREY),
79+
emphasis: Color::AnsiValue(LIGHT_GREY),
80+
command_highlight: Color::AnsiValue(BRAND_PURPLE),
81+
current_item: Color::AnsiValue(BRIGHT_MAGENTA),
7382
}
7483
}
7584
}
7685

7786
impl Default for InteractiveColors {
7887
fn default() -> Self {
7988
Self {
80-
prompt_symbol: Color::AnsiValue(13),
81-
profile_indicator: Color::AnsiValue(141),
82-
tangent_indicator: Color::AnsiValue(13),
89+
prompt_symbol: Color::AnsiValue(BRIGHT_MAGENTA),
90+
profile_indicator: Color::AnsiValue(BRAND_PURPLE),
91+
tangent_indicator: Color::AnsiValue(BRIGHT_MAGENTA),
8392
usage_low: Color::Green,
8493
usage_medium: Color::Yellow,
8594
usage_high: Color::Red,

0 commit comments

Comments
 (0)