From 6dbfa0002b159c19b9cf8f44de48b494814f4287 Mon Sep 17 00:00:00 2001 From: pablu Date: Mon, 11 May 2026 11:57:05 +0200 Subject: Add theming --- src/theme.rs | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/theme.rs (limited to 'src/theme.rs') diff --git a/src/theme.rs b/src/theme.rs new file mode 100644 index 0000000..17db722 --- /dev/null +++ b/src/theme.rs @@ -0,0 +1,69 @@ +use ratatui::style::{Color, Modifier, Style}; + +pub struct Theme; + +impl Theme { + pub const BG: Color = Color::Rgb(30, 30, 46); + + pub const PRIMARY: Color = Color::Rgb(139, 92, 246); + pub const SECONDARY: Color = Color::Rgb(196, 181, 253); + + pub const SUCCESS: Color = Color::Rgb(34, 197, 94); + + pub const WARNING: Color = Color::Rgb(245, 158, 11); + pub const ERROR: Color = Color::Rgb(239, 68, 68); + + pub const TEXT: Color = Color::Rgb(226, 232, 240); + pub const MUTED: Color = Color::Rgb(148, 163, 184); + + pub const INFO: Color = Color::Rgb(56, 189, 248); + + pub fn primary() -> Style { + Style::default().fg(Self::PRIMARY) + } + + pub fn secondary() -> Style { + Style::default().fg(Self::SECONDARY) + } + + pub fn block() -> Style { + Style::default().fg(Self::PRIMARY).bg(Self::BG) + } + + pub fn text() -> Style { + Style::default().fg(Self::TEXT) + } + + pub fn muted() -> Style { + Style::default().fg(Self::MUTED) + } + + pub fn title() -> Style { + Style::default() + .fg(Self::SECONDARY) + .add_modifier(Modifier::BOLD) + } + + pub fn selected() -> Style { + Style::default() + .bg(Self::PRIMARY) + .fg(Self::TEXT) + .add_modifier(Modifier::BOLD) + } + + pub fn success() -> Style { + Style::default().fg(Self::SUCCESS) + } + + pub fn warning() -> Style { + Style::default().fg(Self::WARNING) + } + + pub fn error() -> Style { + Style::default().fg(Self::ERROR) + } + + pub fn info() -> Style { + Style::default().fg(Self::INFO) + } +} -- cgit 1.3.1