egui_thematic/
lib.rs

1//! # egui-thematic
2//!
3//! A comprehensive theme editor and configuration system for [egui](https://github.com/emilk/egui) applications
4//! with live preview, preset management, random theme generation, and persistence.
5//!
6//! ## Features
7//!
8//! - **Full Theme Configuration**: Customize all visual aspects of your egui application
9//! - **Built-in Presets**: Dark and Light themes included out of the box
10//! - **Random Theme Generation**: Generate completely random themes with a single click
11//! - **Live Preview**: See changes in real-time as you edit
12//! - **Persistence**: Save and load themes to/from JSON files
13//! - **Interactive Theme Editor**: Full-featured UI with color pickers and preview panel
14//!
15//! ## Quick Start
16//!
17//! ```rust
18//! use egui_thematic::{ThemeConfig, ThemeEditorState, render_theme_panel};
19//!
20//! let mut theme_editor_state = ThemeEditorState::default();
21//! let mut show_theme_editor = true;
22//!
23//! // In your UI code:
24//! // render_theme_panel(ctx, &mut theme_editor_state, &mut show_theme_editor);
25//! ```
26//!
27//! ## Examples
28//!
29//! ### Using Presets
30//!
31//! ```rust
32//! use egui_thematic::ThemeConfig;
33//!
34//! let dark_theme = ThemeConfig::dark_preset();
35//! let light_theme = ThemeConfig::light_preset();
36//! ```
37//!
38//! ### Generating Random Themes
39//!
40//! ```rust
41//! use egui_thematic::ThemeConfig;
42//!
43//! let random_theme = ThemeConfig::randomize();
44//! ```
45//!
46//! ### Saving and Loading
47//!
48//! ```rust,no_run
49//! # use egui_thematic::ThemeConfig;
50//! # use std::path::Path;
51//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
52//! let theme = ThemeConfig::dark_preset();
53//! theme.save_to_file(Path::new("my_theme.theme.json"))?;
54//!
55//! let loaded = ThemeConfig::load_from_file(Path::new("my_theme.theme.json"))?;
56//! # Ok(())
57//! # }
58//! ```
59
60mod config;
61mod state;
62mod ui;
63
64pub use config::ThemeConfig;
65pub use state::ThemeEditorState;
66pub use ui::{render_theme_editor, render_theme_panel};