| 1 |
|
- |
//! Theme palette: theme-common intents resolved into ratatui `Color`s, plus
|
|
1 |
+ |
//! Theme palette: makeover intents resolved into ratatui `Color`s, plus
|
| 2 |
2 |
|
//! the two Alloy-derived border tokens.
|
| 3 |
3 |
|
//!
|
| 4 |
|
- |
//! Per docs/TOKENS.md, Alloy consumes theme-common `.toml` files (the same
|
|
4 |
+ |
//! Per docs/TOKENS.md, Alloy consumes makeover `.toml` files (the same
|
| 5 |
5 |
|
//! schema every make-family app already reads) and derives two extra tokens
|
| 6 |
6 |
|
//! locally so theme files stay minimal and cross-app compatible:
|
| 7 |
7 |
|
//!
|
| 13 |
13 |
|
//! ratatui is immediate-mode with per-widget styling — there is no global
|
| 14 |
14 |
|
//! visuals object. Widgets in this crate take a `&Theme` at construction time
|
| 15 |
15 |
|
//! and pull colors from it. Apps build one `Theme` per theme load (via
|
| 16 |
|
- |
//! `theme_common::load_theme` + `Theme::from_theme`) and thread it through.
|
|
16 |
+ |
//! `makeover::load_theme` + `Theme::from_theme`) and thread it through.
|
| 17 |
17 |
|
|
| 18 |
18 |
|
use ratatui::style::Color;
|
| 19 |
|
- |
use theme_common::{Rgb, ThemeColors};
|
|
19 |
+ |
use makeover::{Rgb, ThemeColors};
|
| 20 |
20 |
|
|
| 21 |
21 |
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
| 22 |
22 |
|
pub enum Mode {
|
| 72 |
72 |
|
impl std::error::Error for ThemeError {}
|
| 73 |
73 |
|
|
| 74 |
74 |
|
impl Theme {
|
| 75 |
|
- |
/// Resolve a loaded theme-common `ThemeColors` into an Alloy `Theme`.
|
|
75 |
+ |
/// Resolve a loaded makeover `ThemeColors` into an Alloy `Theme`.
|
| 76 |
76 |
|
/// Requires every intent Alloy renders — a malformed or partial theme is
|
| 77 |
77 |
|
/// rejected explicitly rather than silently rendering with defaults.
|
| 78 |
78 |
|
pub fn from_theme(theme: &ThemeColors) -> Result<Self, ThemeError> {
|