46 lines
1.6 KiB
Rust
46 lines
1.6 KiB
Rust
//! Red Bear OS — default TUI skin palette.
|
|
//!
|
|
//! Single source of truth for the Red Bear brand colours used by every
|
|
//! TUI application on Red Bear OS (`tlc`, `cub`, `redbear-info`,
|
|
//! `redbear-netctl-console`, `redbear-wifictl`, `redbear-btctl`, the
|
|
//! `redbear-mtr` family, `redbear-hwutils`, and any future TUI).
|
|
//!
|
|
//! See `local/docs/RED-BEAR-TUI-THEME.md` for the design rationale,
|
|
//! WCAG contrast ratios, and migration plan.
|
|
//!
|
|
//! The palette is **deliberately ratatui-free** at this layer. Apps
|
|
//! that want a `ratatui::style::Color` from a slot do a single
|
|
//! one-line conversion: `Color::Rgb(t.background.0, t.background.1,
|
|
//! t.background.2)`. Keeping this crate free of `ratatui` means
|
|
//! non-ratatui TUI libs (cursive, termion-direct, etc.) can also
|
|
//! consume the palette.
|
|
//!
|
|
//! # Example
|
|
//!
|
|
//! ```
|
|
//! use redbear_tui_theme::REDBEAR_DARK;
|
|
//!
|
|
//! // Render a selection row in a TUI list.
|
|
//! let bg = REDBEAR_DARK.selection_bg;
|
|
//! let fg = REDBEAR_DARK.selection_fg;
|
|
//! assert_eq!((bg.0, bg.1, bg.2), (0x36, 0x52, 0xA0));
|
|
//! assert_eq!((fg.0, fg.1, fg.2), (0xF4, 0xF4, 0xF4));
|
|
//! ```
|
|
//!
|
|
//! # Brand red
|
|
//!
|
|
//! The accent colour `#B52430` is the same red used by `cub`'s
|
|
//! already-shipped `RedBearTheme` and by the Red Bear OS brand
|
|
//! assets (`local/Assets/images/Red Bear OS icon.png` and the
|
|
//! loading background). It is **byte-identical** in both the
|
|
//! dark and light themes; only the *background* flips.
|
|
|
|
#![deny(unsafe_code)]
|
|
#![warn(missing_docs)]
|
|
|
|
pub mod fallback;
|
|
|
|
mod palette;
|
|
|
|
pub use palette::{Rgb, Theme, REDBEAR_DARK, REDBEAR_LIGHT};
|