Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions late-ssh/src/app/common/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub enum ThemeKind {
Monokai = 62,
SolarizedLight = 63,
SolarizedDark = 64,
Crush = 65,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -574,6 +575,12 @@ pub const OPTIONS: &[ThemeOption] = &[
id: "solarized_dark",
label: "Solarized Dark",
},
ThemeOption {
kind: ThemeKind::Crush,
group: ThemeGroup::Ports,
id: "pantera",
label: "Charmtone Pantera",
},
];

pub const DEFAULT_ID: &str = "contrast";
Expand Down Expand Up @@ -2528,6 +2535,38 @@ const PALETTE_SOLARIZED_DARK: Palette = Palette {
badge_gold: Color::Rgb(181, 137, 0),
};

// Ported from Charmbracelet Crush's default Charmtone Pantera theme.
// Credit: Charmbracelet — https://github.com/charmbracelet/crush/blob/main/internal/ui/styles/themes.go
const PALETTE_PANTERA: Palette = Palette {
bg_canvas: Color::Rgb(32, 31, 38),
bg_selection: Color::Rgb(45, 44, 53),
bg_highlight: Color::Rgb(58, 57, 67),
border_dim: Color::Rgb(58, 57, 67),
border: Color::Rgb(77, 76, 87),
border_active: Color::Rgb(107, 80, 255),
text_faint: Color::Rgb(96, 95, 107),
text_dim: Color::Rgb(133, 131, 146),
text_muted: Color::Rgb(191, 188, 200),
text: Color::Rgb(223, 219, 221),
text_bright: Color::Rgb(255, 250, 241),
amber: Color::Rgb(245, 239, 52),
amber_dim: Color::Rgb(191, 151, 111),
amber_glow: Color::Rgb(232, 255, 39),
chat_body: Color::Rgb(223, 219, 221),
chat_author: Color::Rgb(104, 255, 214),
mention: Color::Rgb(232, 255, 39),
success: Color::Rgb(0, 255, 178),
error: Color::Rgb(235, 66, 104),
bot: Color::Rgb(255, 96, 255),
bonsai_sprout: Color::Rgb(18, 199, 143),
bonsai_leaf: Color::Rgb(0, 255, 178),
bonsai_canopy: Color::Rgb(104, 255, 214),
bonsai_bloom: Color::Rgb(255, 132, 255),
badge_bronze: Color::Rgb(191, 151, 111),
badge_silver: Color::Rgb(191, 188, 200),
badge_gold: Color::Rgb(245, 239, 52),
};

thread_local! {
static CURRENT_THEME: Cell<ThemeKind> = const { Cell::new(ThemeKind::Contrast) };
}
Expand Down Expand Up @@ -2655,6 +2694,7 @@ fn palette_for_kind(kind: ThemeKind) -> &'static Palette {
ThemeKind::Late => &PALETTE_LATE,
ThemeKind::SolarizedLight => &PALETTE_SOLARIZED_LIGHT,
ThemeKind::SolarizedDark => &PALETTE_SOLARIZED_DARK,
ThemeKind::Crush => &PALETTE_PANTERA,
}
}

Expand Down