@@ -79,28 +79,56 @@ impl Default for Theme {
79
79
impl Theme {
80
80
/// Create a new theme with the specified variant
81
81
pub fn new ( variant : ThemeVariant ) -> Self {
82
- let colors = match variant {
83
- ThemeVariant :: EverforestDark => ColorPalette {
82
+ // Check if we're in Terminal.app (which has poor RGB support)
83
+ let use_basic_colors = std:: env:: var ( "TERM_PROGRAM" )
84
+ . map ( |term| term == "Apple_Terminal" )
85
+ . unwrap_or ( false ) ;
86
+
87
+ let colors = match ( variant, use_basic_colors) {
88
+ ( ThemeVariant :: EverforestDark , false ) => ColorPalette {
84
89
background : Color :: Rgb ( 45 , 53 , 59 ) , // #2d353b
85
90
foreground : Color :: Rgb ( 211 , 198 , 170 ) , // #d3c6aa
86
91
accent : Color :: Rgb ( 167 , 192 , 128 ) , // #a7c080 (green)
87
92
secondary : Color :: Rgb ( 230 , 126 , 128 ) , // #e67e80 (red)
88
93
info : Color :: Rgb ( 127 , 187 , 179 ) , // #7fbbb3 (aqua)
89
- border : Color :: Rgb ( 130 , 140 , 150 ) , // #828c96 (lighter gray for better contrast)
90
- selection : Color :: Rgb ( 64 , 72 , 78 ) , // #40484e (darker bg)
91
- cursor : Color :: Rgb ( 211 , 198 , 170 ) , // #d3c6aa (same as fg)
92
- warning : Color :: Rgb ( 219 , 188 , 127 ) , // #dbbc7f (yellow/orange)
94
+ border : Color :: Rgb ( 130 , 140 , 150 ) , // #828c96
95
+ selection : Color :: Rgb ( 64 , 72 , 78 ) , // #40484e
96
+ cursor : Color :: Rgb ( 211 , 198 , 170 ) , // #d3c6aa
97
+ warning : Color :: Rgb ( 219 , 188 , 127 ) , // #dbbc7f
93
98
} ,
94
- ThemeVariant :: EverforestLight => ColorPalette {
99
+ ( ThemeVariant :: EverforestLight , false ) => ColorPalette {
95
100
background : Color :: Rgb ( 253 , 246 , 227 ) , // #fdf6e3
96
- foreground : Color :: Rgb ( 76 , 86 , 94 ) , // #4c565e (darker for better readability)
97
- accent : Color :: Rgb ( 141 , 161 , 1 ) , // #8da101 (green)
98
- secondary : Color :: Rgb ( 248 , 85 , 82 ) , // #f85552 (red)
99
- info : Color :: Rgb ( 53 , 167 , 124 ) , // #35a77c (aqua)
100
- border : Color :: Rgb ( 150 , 160 , 170 ) , // #96a0aa (gray)
101
- selection : Color :: Rgb ( 243 , 236 , 217 ) , // #f3ecd9 (darker bg)
102
- cursor : Color :: Rgb ( 76 , 86 , 94 ) , // #4c565e (same as fg)
103
- warning : Color :: Rgb ( 207 , 131 , 44 ) , // #cf832c (yellow/orange)
101
+ foreground : Color :: Rgb ( 76 , 86 , 94 ) , // #4c565e
102
+ accent : Color :: Rgb ( 141 , 161 , 1 ) , // #8da101
103
+ secondary : Color :: Rgb ( 248 , 85 , 82 ) , // #f85552
104
+ info : Color :: Rgb ( 53 , 167 , 124 ) , // #35a77c
105
+ border : Color :: Rgb ( 150 , 160 , 170 ) , // #96a0aa
106
+ selection : Color :: Rgb ( 243 , 236 , 217 ) , // #f3ecd9
107
+ cursor : Color :: Rgb ( 76 , 86 , 94 ) , // #4c565e
108
+ warning : Color :: Rgb ( 207 , 131 , 44 ) , // #cf832c
109
+ } ,
110
+ // Terminal.app fallback colors
111
+ ( ThemeVariant :: EverforestDark , true ) => ColorPalette {
112
+ background : Color :: Reset , // Use terminal's default background
113
+ foreground : Color :: White ,
114
+ accent : Color :: Green ,
115
+ secondary : Color :: Red ,
116
+ info : Color :: Cyan ,
117
+ border : Color :: Gray , // Gray instead of DarkGray for visibility
118
+ selection : Color :: Blue , // Blue selection for better visibility
119
+ cursor : Color :: White ,
120
+ warning : Color :: Yellow ,
121
+ } ,
122
+ ( ThemeVariant :: EverforestLight , true ) => ColorPalette {
123
+ background : Color :: Reset , // Use terminal's default background
124
+ foreground : Color :: Black ,
125
+ accent : Color :: Green ,
126
+ secondary : Color :: Red ,
127
+ info : Color :: Blue , // Blue instead of Cyan for better contrast
128
+ border : Color :: DarkGray , // DarkGray for better contrast
129
+ selection : Color :: Yellow , // Yellow instead of LightYellow
130
+ cursor : Color :: Black ,
131
+ warning : Color :: Magenta , // Magenta for warnings to stand out
104
132
} ,
105
133
} ;
106
134
0 commit comments