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
//! Theme loader module for parsing opencode theme JSON files.
//!
//! This module provides functionality to load themes from JSON files in the
//! opencode theme format, which uses a `defs` section for named color definitions
//! and a `theme` section with semantic color mappings.
//!
//! # JSON Format
//!
//! The opencode theme format consists of:
//!
//! ```json
//! {
//! "defs": {
//! "colorName": "#hexcode",
//! ...
//! },
//! "theme": {
//! "primary": { "dark": "colorName", "light": "colorName" },
//! "error": "#ff0000",
//! ...
//! }
//! }
//! ```
//!
//! # Resolution
//!
//! Color values in the `theme` section can be:
//! - Direct hex colors: `"#ff0000"`
//! - References to defs: `"colorName"` (resolved from `defs`)
//! - Variant objects: `{ "dark": "value", "light": "value" }`
//!
//! # Example
//!
//! ```rust,no_run
//! use ratatui_toolkit::services::theme::{loader, ThemeVariant, AppTheme};
//!
//! // Load from file path
//! let theme = loader::load_theme_file("themes/gruvbox.json", ThemeVariant::Dark)
//! .expect("Failed to load theme");
//!
//! // Load from JSON string
//! let json = r#"{"defs": {"bg": "#282828"}, "theme": {"background": "bg"}}"#;
//! let theme = loader::load_theme_str(json, ThemeVariant::Dark)
//! .expect("Failed to parse theme");
//! ```
pub use ;
pub use load_theme_file;
pub use load_theme_str;
pub use parse_hex_color;
pub use resolve_color_value;
pub use ;