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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
//! Styling system for charts.
//!
//! This module provides comprehensive styling capabilities for charts including
//! color palettes, themes, line styles, and typography. All styling is designed
//! to work efficiently on embedded systems with limited resources.
//!
//! ## Color System
//!
//! ### Color Palettes
//! Pre-defined color palettes optimized for different display types:
//! ```rust
//! use embedded_charts::prelude::*;
//!
//! // Professional color palette (when color-support feature is enabled)
//! #[cfg(feature = "color-support")]
//! let colors = quick::professional_colors();
//!
//! // Nature-inspired palette
//! #[cfg(feature = "color-support")]
//! let nature_colors = quick::nature_colors();
//!
//! // Ocean-themed palette
//! #[cfg(feature = "color-support")]
//! let ocean_colors = quick::ocean_colors();
//!
//! // Custom palette
//! let mut custom_palette: ColorPalette<Rgb565, 8> = ColorPalette::new();
//! custom_palette.add_color(Rgb565::BLUE)?;
//! custom_palette.add_color(Rgb565::RED)?;
//! custom_palette.add_color(Rgb565::GREEN)?;
//! # Ok::<(), embedded_charts::error::ChartError>(())
//! ```
//!
//! ### Color Utilities
//! Advanced color manipulation and interpolation:
//! ```rust
//! use embedded_charts::prelude::*;
//! use embedded_graphics::pixelcolor::Rgb565;
//!
//! // Color interpolation for gradients (if color-support feature enabled)
//! let start_color = Rgb565::BLUE;
//! let end_color = Rgb565::RED;
//! #[cfg(feature = "color-support")]
//! let interpolated = Rgb565::interpolate(start_color, end_color, 0.5);
//!
//! // Color contrasting
//! #[cfg(feature = "color-support")]
//! let contrasting = ColorUtils::contrasting_color(Rgb565::BLUE);
//! ```
//!
//! ## Theme System
//!
//! Complete styling themes for different use cases:
//! ```rust
//! use embedded_charts::prelude::*;
//!
//! // Light theme for bright displays
//! let light_theme = quick::light_theme();
//!
//! // Dark theme for OLED displays
//! let dark_theme = quick::dark_theme();
//!
//! // Vibrant theme for colorful displays
//! let vibrant_theme = quick::vibrant_theme();
//!
//! // Cyberpunk theme for modern aesthetics
//! let cyberpunk_theme = quick::cyberpunk_theme();
//!
//! // Theme provides colors for chart styling
//! let bg_color = dark_theme.background;
//! let text_color = dark_theme.text;
//! ```
//!
//! ### Custom Themes
//! Create custom themes for specific requirements:
//! ```rust
//! use embedded_charts::prelude::*;
//! use embedded_graphics::pixelcolor::Rgb565;
//!
//! // Use predefined themes or access theme colors
//! let custom_bg = Rgb565::BLACK;
//! let custom_text = Rgb565::WHITE;
//! let custom_grid = Rgb565::new(8, 8, 8);
//! let custom_primary = Rgb565::CYAN;
//! let custom_secondary = Rgb565::MAGENTA;
//! ```
//!
//! ## Line Styling
//!
//! Comprehensive line styling options:
//! ```rust
//! use embedded_charts::prelude::*;
//! use embedded_graphics::pixelcolor::Rgb565;
//!
//! // Solid line style
//! let solid_line = LineStyle {
//! color: Rgb565::BLUE,
//! pattern: LinePattern::Solid,
//! cap: LineCap::Round,
//! join: LineJoin::Round,
//! width: 2,
//! };
//!
//! // Dashed line style
//! let dashed_line = LineStyle {
//! color: Rgb565::RED,
//! pattern: LinePattern::Dashed,
//! cap: LineCap::Square,
//! join: LineJoin::Miter,
//! width: 1,
//! };
//!
//! // Dotted line style
//! let dotted_line = LineStyle {
//! color: Rgb565::GREEN,
//! pattern: LinePattern::Dotted,
//! cap: LineCap::Round,
//! join: LineJoin::Round,
//! width: 1,
//! };
//! ```
//!
//! ### Line Patterns
//! Available line patterns:
//! - `LinePattern::Solid` - Continuous line
//! - `LinePattern::Dashed(dash_length, gap_length)` - Dashed line
//! - `LinePattern::Dotted(dot_spacing)` - Dotted line
//!
//! ### Line Caps and Joins
//! Line ending and connection styles:
//! - `LineCap::Butt` - Square end, flush with line
//! - `LineCap::Round` - Rounded end
//! - `LineCap::Square` - Square end, extended beyond line
//! - `LineJoin::Miter` - Sharp corner
//! - `LineJoin::Round` - Rounded corner
//! - `LineJoin::Bevel` - Beveled corner
//!
//! ## Fill Styles
//!
//! Area filling options for charts:
//! ```rust
//! use embedded_charts::prelude::*;
//! use embedded_graphics::pixelcolor::Rgb565;
//!
//! // Solid fill using convenience method
//! let solid_fill = FillStyle::solid(Rgb565::BLUE);
//!
//! // Different color fill
//! let red_fill = FillStyle::solid(Rgb565::RED);
//!
//! // Manual construction
//! let green_fill = FillStyle {
//! pattern: FillPattern::Solid(Rgb565::GREEN),
//! };
//! ```
//!
//! ## Border Styles
//!
//! Customizable border styling:
//! ```rust
//! use embedded_charts::prelude::*;
//! use embedded_graphics::pixelcolor::Rgb565;
//!
//! let line_style = LineStyle::solid(Rgb565::BLACK).width(2);
//! let border_style = BorderStyle::rounded(line_style, 5);
//! ```
//!
//! ## Typography (feature: "fonts")
//!
//! Text styling and font management:
//! ```rust,no_run
//! # #[cfg(feature = "fonts")]
//! # {
//! use embedded_charts::prelude::*;
//! use embedded_graphics::pixelcolor::Rgb565;
//!
//! let text_style = TextStyle {
//! font: Font::Medium,
//! color: Rgb565::BLACK,
//! size: 12,
//! alignment: TextAlignment::Center,
//! };
//!
//! // Apply to chart title
//! let config = chart_config! {
//! title: "My Chart",
//! title_style: text_style,
//! };
//! # }
//! ```
//!
//! ## Color Palettes
//!
//! ### Built-in Palettes
//! - `professional_palette()` - Professional business colors
//! - `pastel_palette()` - Soft, muted colors
//! - `vibrant_palette()` - Bright, energetic colors
//! - `nature_palette()` - Earth and nature tones
//! - `ocean_palette()` - Blue and aqua tones
//! - `sunset_palette()` - Warm orange and red tones
//! - `cyberpunk_palette()` - Neon and electric colors
//! - `minimal_palette()` - Simple black, white, and gray
//! - `retro_palette()` - Vintage-inspired colors
//!
//! ### Palette Usage
//! ```rust
//! use embedded_charts::prelude::*;
//!
//! // Example with a simple palette
//! let mut palette: ColorPalette<Rgb565, 8> = ColorPalette::new();
//! palette.add_color(Rgb565::BLUE)?;
//! palette.add_color(Rgb565::RED)?;
//! palette.add_color(Rgb565::GREEN)?;
//!
//! let primary_color = palette.get_color(0).unwrap_or(Rgb565::WHITE);
//! let secondary_color = palette.get_color(1).unwrap_or(Rgb565::WHITE);
//!
//! // Cycle through colors
//! for i in 0..3 {
//! let color = palette.get_color(i % palette.len()).unwrap_or(Rgb565::WHITE);
//! // Apply color to series...
//! }
//! # Ok::<(), embedded_charts::error::ChartError>(())
//! ```
//!
//! ## Performance Considerations
//!
//! - **Memory Efficient**: All styling uses minimal memory footprint
//! - **Compile-time Optimization**: Many style calculations are done at compile time
//! - **Feature Gating**: Advanced styling features can be disabled to save space
//! - **Display Optimization**: Styles are optimized for different display types
//!
//! ## Display-Specific Optimizations
//!
//! ### OLED Displays
//! - Use dark themes to save power
//! - Avoid large filled areas
//! - Use high contrast colors
//!
//! ### E-Paper Displays
//! - Use monochrome or limited color palettes
//! - Optimize for slow refresh rates
//! - Use high contrast patterns
//!
//! ### TFT Displays
//! - Take advantage of full color range
//! - Use vibrant themes for better visibility
//! - Optimize for fast refresh rates
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;