more on themes
This commit is contained in:
45
src/ui.rs
45
src/ui.rs
@@ -47,6 +47,15 @@ fn palette(theme: &str) -> Palette {
|
||||
selection_foreground: rgb(0xffffff),
|
||||
foreground: Color::Rgb(255, 191, 0),
|
||||
},
|
||||
"greenscreen" => Palette {
|
||||
primary: Color::Black,
|
||||
accent: rgb(0x79a86b),
|
||||
canvas: rgb(0x030704),
|
||||
canvas_heading: rgb(0x9ac58d),
|
||||
selection: rgb(0x284b2f),
|
||||
selection_foreground: rgb(0xdce8d8),
|
||||
foreground: rgb(0x8fbd80),
|
||||
},
|
||||
"nord" => Palette {
|
||||
primary: rgb(0x2e3440),
|
||||
accent: rgb(0x88c0d0),
|
||||
@@ -56,24 +65,6 @@ fn palette(theme: &str) -> Palette {
|
||||
selection_foreground: rgb(0x2e3440),
|
||||
foreground: rgb(0xeceff4),
|
||||
},
|
||||
"solarized-dark" => Palette {
|
||||
primary: rgb(0x002b36),
|
||||
accent: rgb(0x2aa198),
|
||||
canvas: rgb(0x073642),
|
||||
canvas_heading: rgb(0xfdf6e3),
|
||||
selection: rgb(0xfdf6e3),
|
||||
selection_foreground: rgb(0x002b36),
|
||||
foreground: rgb(0x839496),
|
||||
},
|
||||
"solarized-light" => Palette {
|
||||
primary: rgb(0x586e75),
|
||||
accent: rgb(0xeee8d5),
|
||||
canvas: rgb(0xfdf6e3),
|
||||
canvas_heading: rgb(0x002b36),
|
||||
selection: rgb(0x002b36),
|
||||
selection_foreground: rgb(0xfdf6e3),
|
||||
foreground: rgb(0x657b83),
|
||||
},
|
||||
"catppuccin-mocha" => Palette {
|
||||
primary: rgb(0x181825),
|
||||
accent: rgb(0xcba6f7),
|
||||
@@ -1433,9 +1424,8 @@ mod tests {
|
||||
.collect::<String>();
|
||||
assert!(screen.contains("Classic — Lotus-inspired blue"));
|
||||
assert!(screen.contains("Amber — warm dark"));
|
||||
assert!(screen.contains("Greenscreen — muted phosphor green"));
|
||||
assert!(screen.contains("Nord — arctic blue dark"));
|
||||
assert!(screen.contains("Solarized Dark — balanced low contrast"));
|
||||
assert!(screen.contains("Solarized Light — warm paper light"));
|
||||
assert!(screen.contains("Catppuccin Mocha — cozy pastel dark"));
|
||||
|
||||
app.handle_key(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE))
|
||||
@@ -1463,9 +1453,8 @@ mod tests {
|
||||
};
|
||||
assert_eq!(form.values[0], "amber");
|
||||
|
||||
assert_eq!(palette("greenscreen").foreground, Color::Rgb(143, 189, 128));
|
||||
assert_eq!(palette("nord").primary, Color::Rgb(46, 52, 64));
|
||||
assert_eq!(palette("solarized-dark").canvas, Color::Rgb(7, 54, 66));
|
||||
assert_eq!(palette("solarized-light").canvas, Color::Rgb(253, 246, 227));
|
||||
assert_eq!(
|
||||
palette("catppuccin-mocha").foreground,
|
||||
Color::Rgb(205, 214, 244)
|
||||
@@ -1482,13 +1471,8 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn added_themes_keep_selected_rows_at_high_contrast() {
|
||||
for theme in [
|
||||
"nord",
|
||||
"solarized-dark",
|
||||
"solarized-light",
|
||||
"catppuccin-mocha",
|
||||
] {
|
||||
fn additional_themes_keep_selected_rows_at_high_contrast() {
|
||||
for theme in ["greenscreen", "nord", "catppuccin-mocha"] {
|
||||
let colors = palette(theme);
|
||||
let ratio = contrast_ratio(colors.selection_foreground, colors.selection);
|
||||
assert!(
|
||||
@@ -1504,9 +1488,8 @@ mod tests {
|
||||
"classic",
|
||||
"mono",
|
||||
"amber",
|
||||
"greenscreen",
|
||||
"nord",
|
||||
"solarized-dark",
|
||||
"solarized-light",
|
||||
"catppuccin-mocha",
|
||||
] {
|
||||
let colors = palette(theme);
|
||||
|
||||
Reference in New Issue
Block a user