Files
Kigi-CLI/crates/codegen/kigi-pager-render/src/theme/oscura.rs
T
ZacharyZhang-NY a02b555e66 docs(comments): rewrite comments across all crates to the guidelines
Sweep every first-party crate source (1956 .rs files) to the project comment
guidelines: delete redundant restatements, decorative banners, change
narration, and end-of-line comments; keep and tighten the crucial ones
(invariants, bug rationale, SAFETY blocks, ported-source attribution).

No functional code changed. Every edit is proven comment-only against the
prior tree by a comment-stripping lexer (string/char/raw-string aware) plus a
separate doctest-fence check. Where removing a comment made rustfmt or clippy
want to re-lay-out adjacent code, the minimal triggering comment is restored so
code tokens stay byte-identical.

Gates green: cargo fmt --all --check (0 diffs), cargo check and cargo clippy
--workspace --all-targets (0 warnings).

Adds scripts/check_codegen_comment_guidelines.py — the enforcement gate for
these guidelines (flags banners, end-of-line comments, change narration, and
commented-out code).
2026-07-23 16:55:39 -04:00

166 lines
5.3 KiB
Rust

use ratatui::style::{Color, Modifier};
use super::tokyonight::Theme;
const fn rgb(r: u8, g: u8, b: u8) -> Color {
Color::Rgb(r, g, b)
}
/// Oscura Midnight palette.
///
/// Deep, dark backgrounds with a subtle purple/blue tint (OKLCH hue 265),
/// inspired by the Oscura Midnight palette (narative/oscura). Accent colors
/// lean purple to give the theme its distinctive identity.
///
/// Base colors were converted from OKLCH to sRGB programmatically via
/// the `coloraide` Python library. Purple accent colors are hand-picked
/// to complement the hue-265 background tint.
#[allow(dead_code)]
mod palette {
use super::*;
// backgrounds (OKLCH hue 265 backgrounds, OKLCH hue 265)
// #030304 oklch(0.1 0.005 265)
pub const BASE: Color = rgb(3, 3, 4);
// #040507 oklch(0.115 0.005 265)
pub const SURFACE: Color = rgb(4, 5, 7);
// #0F1216 oklch(0.18 0.01 265)
pub const ELEVATED: Color = rgb(15, 18, 22);
// #040406 oklch(0.11 0.006 265)
pub const PANEL: Color = rgb(4, 4, 6);
// text (neutral, no color cast)
// #E4E4E4 oklch(0.92 0 0)
pub const TEXT: Color = rgb(228, 228, 228);
// #BEBEBE oklch(0.8 0 0)
pub const TEXT_DIM: Color = rgb(190, 190, 190);
// muted text (slight blue-purple tint)
// #81868F oklch(0.62 0.015 260)
pub const MUTED: Color = rgb(129, 134, 143);
// #5E646C oklch(0.5 0.015 260)
pub const SUBTLE: Color = rgb(94, 100, 108);
// semantic colors (from desktop action tokens)
// #EBD96E oklch(0.88 0.13 100)
pub const GOLD: Color = rgb(235, 217, 110);
// #DC5A64 muted rose-red
pub const RED: Color = rgb(220, 90, 100);
// #50B48C softened teal
pub const TEAL: Color = rgb(80, 180, 140);
// #F1BD00 oklch(0.82 0.18 90)
pub const AMBER: Color = rgb(241, 189, 0);
// purple accent ramp (the "purple hints")
// #9B7ECE — signature purple
pub const PURPLE: Color = rgb(155, 126, 206);
// #6E5A9A — muted purple
pub const PURPLE_DIM: Color = rgb(110, 90, 154);
// #C4A7E7 — vivid lavender
pub const PURPLE_BRIGHT: Color = rgb(196, 167, 231);
// cyan (for running indicators, links)
pub const CYAN: Color = rgb(125, 207, 223);
// highlight ramp (purple-tinted grays for UI chrome)
pub const HIGHLIGHT_LOW: Color = rgb(18, 16, 28);
pub const HIGHLIGHT_MED: Color = rgb(36, 32, 52);
pub const HIGHLIGHT_HIGH: Color = rgb(52, 48, 72);
}
use palette::*;
impl Theme {
pub const fn oscura_midnight() -> Self {
Self {
bg_base: BASE,
bg_light: ELEVATED,
bg_dark: SURFACE,
bg_highlight: ELEVATED,
bg_hover: HIGHLIGHT_MED,
bg_terminal: BASE,
accent_user: PURPLE_BRIGHT,
accent_assistant: PURPLE,
accent_thinking: MUTED,
accent_tool: SUBTLE,
accent_system: CYAN,
accent_error: RED,
accent_success: TEAL,
accent_running: PURPLE_DIM,
accent_skill: PURPLE,
text_primary: TEXT,
text_secondary: TEXT_DIM,
gray_dim: SUBTLE,
gray: MUTED,
gray_bright: TEXT_DIM,
command: GOLD,
path: AMBER,
running: CYAN,
warning: GOLD,
fuzzy_accent: PURPLE_BRIGHT,
accent_plan: GOLD,
accent_verify: PURPLE,
accent_feedback: TEAL,
// #8BC34A — Material Design light green
accent_remember: rgb(139, 195, 74),
selection_border: HIGHLIGHT_HIGH,
hover_border: HIGHLIGHT_MED,
prompt_border: HIGHLIGHT_MED,
prompt_border_active: HIGHLIGHT_HIGH,
accent_model: CYAN,
// Thumb must sit clearly above the track: `ELEVATED` (Σrgb 55)
// was *darker* than the `HIGHLIGHT_LOW` track (Σrgb 62), which
// made the scrollbar invisible — and follow mode blends the
// thumb 40% toward the track, shrinking the delta further.
// `HIGHLIGHT_HIGH` matches the weight of the theme's visible
// chrome (selection border) and Rose Pine's thumb brightness.
scrollbar_bg: HIGHLIGHT_LOW,
scrollbar_fg: HIGHLIGHT_HIGH,
diff_delete_bg: rgb(45, 15, 25),
diff_delete_fg: RED,
diff_insert_bg: rgb(10, 35, 30),
diff_insert_fg: TEAL,
diff_equal_fg: MUTED,
diff_gutter_fg: MUTED,
bg_visual: HIGHLIGHT_MED,
paste_bg: SURFACE,
paste_fg: TEXT_DIM,
paste_dim: MUTED,
md_heading_h1: TEXT,
md_heading_h1_mod: Modifier::BOLD,
md_heading_h2: PURPLE_BRIGHT,
md_heading_h2_mod: Modifier::BOLD,
md_heading_h3: PURPLE,
md_heading_h3_mod: Modifier::BOLD,
md_heading_h4: TEAL,
md_heading_h4_mod: Modifier::BOLD.union(Modifier::ITALIC),
md_heading_h5: GOLD,
md_heading_h5_mod: Modifier::BOLD,
md_heading_h6: CYAN,
md_heading_h6_mod: Modifier::BOLD,
md_code: CYAN,
md_task_checked: TEAL,
md_task_unchecked: TEXT_DIM,
md_muted: MUTED,
md_code_bg: SURFACE,
md_text: TEXT,
link_fg: CYAN,
}
}
}