fp-dotfiles-tui 0.2.5

Minimal premium TUI for fp-dotfiles-manager
//! Catppuccin Mocha color palette for the TUI.
//!
//! Palette reference: <https://github.com/catppuccin/catppuccin>
//! Flavor: Mocha (dark).

use ratatui::style::{Color, Modifier, Style};

// ── Catppuccin Mocha (tokens in use) ────────────────────────────────────────

pub const BASE: Color = Color::Rgb(0x1e, 0x1e, 0x2e);
pub const MANTLE: Color = Color::Rgb(0x18, 0x18, 0x25);
pub const SURFACE0: Color = Color::Rgb(0x31, 0x32, 0x44);
pub const SURFACE2: Color = Color::Rgb(0x58, 0x5b, 0x70);
pub const OVERLAY1: Color = Color::Rgb(0x7f, 0x84, 0x9c);
pub const TEXT_COLOR: Color = Color::Rgb(0xcd, 0xd6, 0xf4);
pub const LAVENDER: Color = Color::Rgb(0xb4, 0xbe, 0xfe);
pub const BLUE: Color = Color::Rgb(0x89, 0xb4, 0xfa);
pub const GREEN: Color = Color::Rgb(0xa6, 0xe3, 0xa1);
pub const PEACH: Color = Color::Rgb(0xfa, 0xb3, 0x87);
pub const RED: Color = Color::Rgb(0xf3, 0x8b, 0xa8);
pub const MAUVE: Color = Color::Rgb(0xcb, 0xa6, 0xf7);

// ── Semantic roles (used by ui.rs) ──────────────────────────────────────────

/// Main canvas background (`base`).
pub const BG: Color = BASE;
/// Raised panels / header / footer (`mantle`).
pub const SURFACE: Color = MANTLE;
/// Idle borders (`surface2`).
pub const BORDER: Color = SURFACE2;
/// Focused borders (`lavender`).
pub const BORDER_FOCUS: Color = LAVENDER;
/// Primary body text (`text`).
pub const TEXT: Color = TEXT_COLOR;
/// Secondary / dim text (`overlay1`).
pub const MUTED: Color = OVERLAY1;
/// Interactive accent (`mauve` — Catppuccin signature).
pub const ACCENT: Color = MAUVE;
/// Success / ok (`green`).
pub const SUCCESS: Color = GREEN;
/// Warnings / fox mark (`peach`).
pub const WARN: Color = PEACH;
/// Errors / failures (`red`).
pub const ERROR: Color = RED;
/// Selection / active tab background (`surface0`).
pub const HIGHLIGHT_BG: Color = SURFACE0;
/// Titles (`lavender`).
pub const TITLE: Color = LAVENDER;

pub fn title() -> Style {
    Style::default()
        .fg(TITLE)
        .add_modifier(Modifier::BOLD)
}

pub fn border() -> Style {
    Style::default().fg(BORDER)
}

pub fn border_focus() -> Style {
    Style::default().fg(BORDER_FOCUS)
}

pub fn normal() -> Style {
    Style::default().fg(TEXT)
}

pub fn muted() -> Style {
    Style::default().fg(MUTED)
}

pub fn accent() -> Style {
    Style::default().fg(ACCENT)
}

pub fn selected() -> Style {
    Style::default()
        .fg(TEXT)
        .bg(HIGHLIGHT_BG)
        .add_modifier(Modifier::BOLD)
}

pub fn selected_marker() -> Style {
    Style::default()
        .fg(ACCENT)
        .bg(HIGHLIGHT_BG)
        .add_modifier(Modifier::BOLD)
}

pub fn category_active() -> Style {
    Style::default()
        .fg(ACCENT)
        .add_modifier(Modifier::BOLD)
}

pub fn category_idle() -> Style {
    Style::default().fg(MUTED)
}

pub fn success() -> Style {
    Style::default().fg(SUCCESS)
}

pub fn warn() -> Style {
    Style::default().fg(WARN)
}

pub fn error() -> Style {
    Style::default().fg(ERROR)
}

pub fn keybind() -> Style {
    Style::default()
        .fg(BLUE)
        .add_modifier(Modifier::BOLD)
}