Skip to main content

redbear_tui_theme/
lib.rs

1//! Red Bear OS — default TUI skin palette.
2//!
3//! Single source of truth for the Red Bear brand colours used by every
4//! TUI application on Red Bear OS (`tlc`, `cub`, `redbear-info`,
5//! `redbear-netctl-console`, `redbear-wifictl`, `redbear-btctl`, the
6//! `redbear-mtr` family, `redbear-hwutils`, and any future TUI).
7//!
8//! See `local/docs/RED-BEAR-TUI-THEME.md` for the design rationale,
9//! WCAG contrast ratios, and migration plan.
10//!
11//! The palette is **deliberately ratatui-free** at this layer. Apps
12//! that want a `ratatui::style::Color` from a slot do a single
13//! one-line conversion: `Color::Rgb(t.background.0, t.background.1,
14//! t.background.2)`. Keeping this crate free of `ratatui` means
15//! non-ratatui TUI libs (cursive, termion-direct, etc.) can also
16//! consume the palette.
17//!
18//! # Example
19//!
20//! ```
21//! use redbear_tui_theme::REDBEAR_DARK;
22//!
23//! // Render a selection row in a TUI list.
24//! let bg = REDBEAR_DARK.selection_bg;
25//! let fg = REDBEAR_DARK.selection_fg;
26//! assert_eq!((bg.0, bg.1, bg.2), (0x36, 0x52, 0xA0));
27//! assert_eq!((fg.0, fg.1, fg.2), (0xF4, 0xF4, 0xF4));
28//! ```
29//!
30//! # Brand red
31//!
32//! The accent colour `#B52430` is the same red used by `cub`'s
33//! already-shipped `RedBearTheme` and by the Red Bear OS brand
34//! assets (`local/Assets/images/Red Bear OS icon.png` and the
35//! loading background). It is **byte-identical** in both the
36//! dark and light themes; only the *background* flips.
37
38#![deny(unsafe_code)]
39#![warn(missing_docs)]
40
41pub mod fallback;
42
43mod palette;
44
45pub use palette::{Rgb, Theme, REDBEAR_DARK, REDBEAR_LIGHT};