photon_ui/theme/mod.rs
1//! The Beam Design Language theme system for photon-ui.
2//!
3//! Provides color palettes, semantic tokens, ANSI rendering, and
4//! composable text styles for terminal UIs.
5//!
6//! # Quick start
7//!
8//! ```
9//! use photon_ui::theme::{
10//! Palette,
11//! Style,
12//! Theme,
13//! stylize,
14//! };
15//!
16//! Theme::set(Theme::Light);
17//! let accent = Theme::current().accent();
18//! let styled = stylize("Hello", &Style::new().fg(accent).bold());
19//! ```
20//!
21//! # Switching themes on demand
22//!
23//! ```
24//! use photon_ui::theme::{
25//! Palette,
26//! Theme,
27//! };
28//!
29//! Theme::set(Theme::Dark);
30//! assert_eq!(Theme::current().bg_page().to_hex(), "#1f1f1f");
31//!
32//! Theme::set(Theme::Light);
33//! assert_eq!(Theme::current().bg_page().to_hex(), "#fffaed");
34//! ```
35
36pub mod ansi;
37pub mod color;
38pub mod palette;
39pub mod style;
40
41pub use ansi::{
42 ColorMode,
43 RESET,
44 bg,
45 fg,
46};
47pub use color::Color;
48pub use palette::{
49 Palette,
50 Theme,
51};
52pub use style::{
53 Style,
54 stylize,
55 stylize_padded,
56};