1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! # tui-nuances
//!
//! Shared theming for [ratatui](https://ratatui.rs) widget libraries
//! (`tui-chart`, `tui-slider`, `tui-spinner`, `tui-rating`, `tui-piechart`,
//! `tui-checkbox`, `tui-file-explorer`, …): build **one** [`Theme`] and style
//! every component of your app from it.
//!
//! * [`Theme`] – ~30 named color slots (UI, status, selection, data-viz) with
//! 16 built-ins: `default`, `catppuccin-mocha`, `catppuccin-latte`,
//! `dracula`, `nord`, `gruvbox`, `tokyo-night`, `solarized-dark`,
//! `solarized-light`, `one-dark`, `rose-pine`, `monokai`, `porsche`,
//! `colorblind`, `high-contrast`, `mono`.
//! * [`Theme::from_base`] / [`Theme::from_palette`] – derive a full theme from a
//! few colors your app already has.
//! * Semantic styles – [`Theme::style`], [`Theme::selected_style`],
//! [`Theme::border_style`], [`Theme::status_style`] …
//! * [`color`] – mix / lighten / darken, WCAG contrast, [`color::readable_on`],
//! 256/16-color quantisation.
//! * [`ColorSupport`] + [`Theme::downgrade`] – adapt to the terminal
//! (`COLORTERM`, `TERM`, `NO_COLOR`).
//! * [`Themed`] / [`ThemeProvider`] – glue for widget crates and app theme types.
//! * [`ThemeSwitcher`] – cycle themes in demos.
//!
//! ```
//! use ratatui::{style::Color, widgets::{Block, Borders, Paragraph}};
//! use tui_nuances::{Status, Theme};
//!
//! let theme = Theme::by_name("tokyo-night").unwrap();
//! let block = Block::default()
//! .borders(Borders::ALL)
//! .border_style(theme.border_style(true))
//! .title_style(theme.title_style())
//! .style(theme.style());
//! let ok = Paragraph::new("all good").style(theme.status_style(Status::Success));
//! # let _ = (block, ok);
//! assert!(theme.palette.len() >= 8);
//! ```
//!
//! # Features
//!
//! * `serde` – `Serialize`/`Deserialize` for [`Theme`] (flat map of color strings).
//!
//! # Depending on it
//!
//! ```toml
//! tui-nuances = { git = "https://github.com/sorinirimies/tui-nuances" }
//! ```
pub use ;
pub use Status;
pub use ColorSupport;
pub use ThemeSwitcher;
pub use ;