Skip to main content

mecomp_tui/ui/
colors.rs

1use std::sync::Once;
2
3use mecomp_core::OnceLockDefault;
4
5// app border colors
6pub static APP_BORDER: OnceLockDefault<material::HexColor> =
7    OnceLockDefault::new(material::PINK_900);
8pub static APP_BORDER_TEXT: OnceLockDefault<material::HexColor> =
9    OnceLockDefault::new(material::PINK_300);
10
11// border colors
12pub static BORDER_UNFOCUSED: OnceLockDefault<material::HexColor> =
13    OnceLockDefault::new(material::RED_900);
14pub static BORDER_FOCUSED: OnceLockDefault<material::HexColor> =
15    OnceLockDefault::new(material::RED_200);
16
17// Popup border colors
18pub static POPUP_BORDER: OnceLockDefault<material::HexColor> =
19    OnceLockDefault::new(material::LIGHT_BLUE_500);
20
21// text colors
22pub static TEXT_NORMAL: OnceLockDefault<material::HexColor> = OnceLockDefault::new(material::WHITE);
23pub static TEXT_HIGHLIGHT: OnceLockDefault<material::HexColor> =
24    OnceLockDefault::new(material::RED_600);
25pub static TEXT_HIGHLIGHT_ALT: OnceLockDefault<material::HexColor> =
26    OnceLockDefault::new(material::RED_200);
27
28// gauge colors, such as song progress bar
29pub static GAUGE_FILLED: OnceLockDefault<material::HexColor> =
30    OnceLockDefault::new(material::WHITE);
31pub static GAUGE_UNFILLED: OnceLockDefault<material::HexColor> =
32    OnceLockDefault::new(material::BLACK);
33
34pub static COLORS_INITIALIZED: Once = Once::new();
35
36/// Initialize the colors for the app at once.
37///
38/// # Memory
39///
40/// This function uses `Box::leak` to leak the memory of the string slices.
41///
42/// This shouldn't be a problem though, since this function is only called once as part of the app initialization.
43pub fn initialize_colors(theme: mecomp_core::config::TuiColorScheme) {
44    macro_rules! set_color {
45        ($color:ident, $value:expr) => {
46            if let Some(color) =
47                $value.and_then(|c| material::HexColor::parse(Box::leak(c.into_boxed_str())))
48            {
49                $color.set(color).ok();
50            }
51        };
52    }
53
54    // Initialize the colors only once
55    COLORS_INITIALIZED.call_once(|| {
56        // Set the colors
57        set_color!(APP_BORDER, theme.app_border);
58        set_color!(APP_BORDER_TEXT, theme.app_border_text);
59        set_color!(BORDER_UNFOCUSED, theme.border_unfocused);
60        set_color!(BORDER_FOCUSED, theme.border_focused);
61        set_color!(POPUP_BORDER, theme.popup_border);
62        set_color!(TEXT_NORMAL, theme.text_normal);
63        set_color!(TEXT_HIGHLIGHT, theme.text_highlight);
64        set_color!(TEXT_HIGHLIGHT_ALT, theme.text_highlight_alt);
65        set_color!(GAUGE_FILLED, theme.gauge_filled);
66        set_color!(GAUGE_UNFILLED, theme.gauge_unfilled);
67    });
68}
69
70#[must_use]
71pub fn border_color(is_focused: bool) -> material::HexColor {
72    if is_focused {
73        *BORDER_FOCUSED
74    } else {
75        *BORDER_UNFOCUSED
76    }
77}
78
79#[cfg(test)]
80mod tests {
81    use super::*;
82    use mecomp_core::config::TuiColorScheme;
83    use pretty_assertions::assert_eq;
84
85    #[test]
86    fn test_border_color() {
87        let focused = border_color(true);
88        let unfocused = border_color(false);
89        assert_eq!(focused, *BORDER_FOCUSED);
90        assert_eq!(unfocused, *BORDER_UNFOCUSED);
91    }
92
93    #[test]
94    fn test_colors() {
95        // Test that the default colors are set correctly
96        assert_eq!(*APP_BORDER, material::PINK_900);
97        assert_eq!(*APP_BORDER_TEXT, material::PINK_300);
98        assert_eq!(*BORDER_UNFOCUSED, material::RED_900);
99        assert_eq!(*BORDER_FOCUSED, material::RED_200);
100        assert_eq!(*POPUP_BORDER, material::LIGHT_BLUE_500);
101        assert_eq!(*TEXT_NORMAL, material::WHITE);
102        assert_eq!(*TEXT_HIGHLIGHT, material::RED_600);
103        assert_eq!(*TEXT_HIGHLIGHT_ALT, material::RED_200);
104        assert_eq!(*GAUGE_FILLED, material::WHITE);
105        assert_eq!(*GAUGE_UNFILLED, material::BLACK);
106
107        // Test that the colors are initialized only once
108        let theme = TuiColorScheme {
109            app_border: Some(material::PINK_900.to_string()),
110            app_border_text: Some(material::PINK_300.to_string()),
111            border_unfocused: Some(material::RED_900.to_string()),
112            border_focused: Some(material::RED_200.to_string()),
113            popup_border: Some(material::LIGHT_BLUE_500.to_string()),
114            text_normal: Some(material::WHITE.to_string()),
115            text_highlight: Some(material::RED_600.to_string()),
116            text_highlight_alt: Some(material::RED_200.to_string()),
117            gauge_filled: Some(material::WHITE.to_string()),
118            gauge_unfilled: Some(material::BLACK.to_string()),
119        };
120
121        // Initialize the colors
122        initialize_colors(theme);
123
124        // Test that the colors are set
125        assert!(APP_BORDER.is_initialized());
126        assert!(APP_BORDER_TEXT.is_initialized());
127        assert!(BORDER_UNFOCUSED.is_initialized());
128        assert!(BORDER_FOCUSED.is_initialized());
129        assert!(POPUP_BORDER.is_initialized());
130        assert!(TEXT_NORMAL.is_initialized());
131        assert!(TEXT_HIGHLIGHT.is_initialized());
132        assert!(TEXT_HIGHLIGHT_ALT.is_initialized());
133        assert!(GAUGE_FILLED.is_initialized());
134        assert!(GAUGE_UNFILLED.is_initialized());
135    }
136}
137
138pub mod material {
139    //! # Material Design Colors
140    //!
141    //! This module provides the 2014 Material Design System [color palettes] as constants.
142    //!
143    //! [color palettes]: https://m2.material.io/design/color/the-color-system.html#tools-for-picking-colors
144    //!
145    //! Ripped from [the material crate](https://github.com/azorng/material/blob/0b6205cf2e6750d92d0ecf7de5779bbf5caa1838/src/lib.rs#L64-L598),
146    //! which we don't use directly because it brings in other things we don't need.
147    #![allow(dead_code)]
148
149    #[derive(Debug, Clone, Copy, PartialEq, Eq)]
150    pub struct HexColor(&'static str);
151
152    impl HexColor {
153        /// Parse a hex color string.
154        /// Can be a hex string like `#ff0000` or a material color name like `red_500` or `LIGHT_BLUE_100`.
155        /// Returns a `HexColor` if the string is valid, otherwise returns None.
156        #[must_use]
157        pub fn parse(s: &'static str) -> Option<Self> {
158            // First parse the string into a hex color
159            let candidate = if s.len() == 7 && s.starts_with('#') {
160                Self(s)
161            } else if let Some((_, hex)) = MATERIAL_COLORS
162                .iter()
163                .find(|(name, _)| *name == s.to_ascii_lowercase())
164            {
165                *hex
166            } else {
167                return None;
168            };
169
170            // double check that the hex color is valid
171            if candidate.0.len() == 7
172                && candidate.0.starts_with('#')
173                && candidate.0[1..].chars().all(|c| c.is_ascii_hexdigit())
174            {
175                Some(candidate)
176            } else {
177                None
178            }
179        }
180    }
181
182    impl From<HexColor> for ratatui::style::Color {
183        /// Converts to a Ratatui Color from the `HexColor`.
184        fn from(hex_color: HexColor) -> Self {
185            let s = hex_color.0;
186            let (r, g, b) = (
187                u8::from_str_radix(&s[1..3], 16).unwrap_or_default(),
188                u8::from_str_radix(&s[3..5], 16).unwrap_or_default(),
189                u8::from_str_radix(&s[5..7], 16).unwrap_or_default(),
190            );
191
192            Self::Rgb(r, g, b)
193        }
194    }
195
196    impl std::fmt::Display for HexColor {
197        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
198            write!(f, "{}", self.0)
199        }
200    }
201
202    /// a lookup table for the colors
203    static MATERIAL_COLORS: &[(&str, HexColor)] = &[
204        // reds
205        ("red_50", RED_50),
206        ("red_100", RED_100),
207        ("red_200", RED_200),
208        ("red_300", RED_300),
209        ("red_400", RED_400),
210        ("red_500", RED_500),
211        ("red_600", RED_600),
212        ("red_700", RED_700),
213        ("red_800", RED_800),
214        ("red_900", RED_900),
215        ("red_a100", RED_A100),
216        ("red_a200", RED_A200),
217        ("red_a400", RED_A400),
218        ("red_a700", RED_A700),
219        // pinks
220        ("pink_50", PINK_50),
221        ("pink_100", PINK_100),
222        ("pink_200", PINK_200),
223        ("pink_300", PINK_300),
224        ("pink_400", PINK_400),
225        ("pink_500", PINK_500),
226        ("pink_600", PINK_600),
227        ("pink_700", PINK_700),
228        ("pink_800", PINK_800),
229        ("pink_900", PINK_900),
230        ("pink_a100", PINK_A100),
231        ("pink_a200", PINK_A200),
232        ("pink_a400", PINK_A400),
233        ("pink_a700", PINK_A700),
234        // purples
235        ("purple_50", PURPLE_50),
236        ("purple_100", PURPLE_100),
237        ("purple_200", PURPLE_200),
238        ("purple_300", PURPLE_300),
239        ("purple_400", PURPLE_400),
240        ("purple_500", PURPLE_500),
241        ("purple_600", PURPLE_600),
242        ("purple_700", PURPLE_700),
243        ("purple_800", PURPLE_800),
244        ("purple_900", PURPLE_900),
245        ("purple_a100", PURPLE_A100),
246        ("purple_a200", PURPLE_A200),
247        ("purple_a400", PURPLE_A400),
248        ("purple_a700", PURPLE_A700),
249        // deep purples
250        ("deep_purple_50", DEEP_PURPLE_50),
251        ("deep_purple_100", DEEP_PURPLE_100),
252        ("deep_purple_200", DEEP_PURPLE_200),
253        ("deep_purple_300", DEEP_PURPLE_300),
254        ("deep_purple_400", DEEP_PURPLE_400),
255        ("deep_purple_500", DEEP_PURPLE_500),
256        ("deep_purple_600", DEEP_PURPLE_600),
257        ("deep_purple_700", DEEP_PURPLE_700),
258        ("deep_purple_800", DEEP_PURPLE_800),
259        ("deep_purple_900", DEEP_PURPLE_900),
260        ("deep_purple_a100", DEEP_PURPLE_A100),
261        ("deep_purple_a200", DEEP_PURPLE_A200),
262        ("deep_purple_a400", DEEP_PURPLE_A400),
263        ("deep_purple_a700", DEEP_PURPLE_A700),
264        // indigos
265        ("indigo_50", INDIGO_50),
266        ("indigo_100", INDIGO_100),
267        ("indigo_200", INDIGO_200),
268        ("indigo_300", INDIGO_300),
269        ("indigo_400", INDIGO_400),
270        ("indigo_500", INDIGO_500),
271        ("indigo_600", INDIGO_600),
272        ("indigo_700", INDIGO_700),
273        ("indigo_800", INDIGO_800),
274        ("indigo_900", INDIGO_900),
275        ("indigo_a100", INDIGO_A100),
276        ("indigo_a200", INDIGO_A200),
277        ("indigo_a400", INDIGO_A400),
278        ("indigo_a700", INDIGO_A700),
279        // blues
280        ("blue_50", BLUE_50),
281        ("blue_100", BLUE_100),
282        ("blue_200", BLUE_200),
283        ("blue_300", BLUE_300),
284        ("blue_400", BLUE_400),
285        ("blue_500", BLUE_500),
286        ("blue_600", BLUE_600),
287        ("blue_700", BLUE_700),
288        ("blue_800", BLUE_800),
289        ("blue_900", BLUE_900),
290        ("blue_a100", BLUE_A100),
291        ("blue_a200", BLUE_A200),
292        ("blue_a400", BLUE_A400),
293        ("blue_a700", BLUE_A700),
294        // light blues
295        ("light_blue_50", LIGHT_BLUE_50),
296        ("light_blue_100", LIGHT_BLUE_100),
297        ("light_blue_200", LIGHT_BLUE_200),
298        ("light_blue_300", LIGHT_BLUE_300),
299        ("light_blue_400", LIGHT_BLUE_400),
300        ("light_blue_500", LIGHT_BLUE_500),
301        ("light_blue_600", LIGHT_BLUE_600),
302        ("light_blue_700", LIGHT_BLUE_700),
303        ("light_blue_800", LIGHT_BLUE_800),
304        ("light_blue_900", LIGHT_BLUE_900),
305        ("light_blue_a100", LIGHT_BLUE_A100),
306        ("light_blue_a200", LIGHT_BLUE_A200),
307        ("light_blue_a400", LIGHT_BLUE_A400),
308        ("light_blue_a700", LIGHT_BLUE_A700),
309        // cyans
310        ("cyan_50", CYAN_50),
311        ("cyan_100", CYAN_100),
312        ("cyan_200", CYAN_200),
313        ("cyan_300", CYAN_300),
314        ("cyan_400", CYAN_400),
315        ("cyan_500", CYAN_500),
316        ("cyan_600", CYAN_600),
317        ("cyan_700", CYAN_700),
318        ("cyan_800", CYAN_800),
319        ("cyan_900", CYAN_900),
320        ("cyan_a100", CYAN_A100),
321        ("cyan_a200", CYAN_A200),
322        ("cyan_a400", CYAN_A400),
323        ("cyan_a700", CYAN_A700),
324        // teals
325        ("teal_50", TEAL_50),
326        ("teal_100", TEAL_100),
327        ("teal_200", TEAL_200),
328        ("teal_300", TEAL_300),
329        ("teal_400", TEAL_400),
330        ("teal_500", TEAL_500),
331        ("teal_600", TEAL_600),
332        ("teal_700", TEAL_700),
333        ("teal_800", TEAL_800),
334        ("teal_900", TEAL_900),
335        ("teal_a100", TEAL_A100),
336        ("teal_a200", TEAL_A200),
337        ("teal_a400", TEAL_A400),
338        ("teal_a700", TEAL_A700),
339        // greens
340        ("green_50", GREEN_50),
341        ("green_100", GREEN_100),
342        ("green_200", GREEN_200),
343        ("green_300", GREEN_300),
344        ("green_400", GREEN_400),
345        ("green_500", GREEN_500),
346        ("green_600", GREEN_600),
347        ("green_700", GREEN_700),
348        ("green_800", GREEN_800),
349        ("green_900", GREEN_900),
350        ("green_a100", GREEN_A100),
351        ("green_a200", GREEN_A200),
352        ("green_a400", GREEN_A400),
353        ("green_a700", GREEN_A700),
354        // light greens
355        ("light_green_50", LIGHT_GREEN_50),
356        ("light_green_100", LIGHT_GREEN_100),
357        ("light_green_200", LIGHT_GREEN_200),
358        ("light_green_300", LIGHT_GREEN_300),
359        ("light_green_400", LIGHT_GREEN_400),
360        ("light_green_500", LIGHT_GREEN_500),
361        ("light_green_600", LIGHT_GREEN_600),
362        ("light_green_700", LIGHT_GREEN_700),
363        ("light_green_800", LIGHT_GREEN_800),
364        ("light_green_900", LIGHT_GREEN_900),
365        ("light_green_a100", LIGHT_GREEN_A100),
366        ("light_green_a200", LIGHT_GREEN_A200),
367        ("light_green_a400", LIGHT_GREEN_A400),
368        ("light_green_a700", LIGHT_GREEN_A700),
369        // limes
370        ("lime_50", LIME_50),
371        ("lime_100", LIME_100),
372        ("lime_200", LIME_200),
373        ("lime_300", LIME_300),
374        ("lime_400", LIME_400),
375        ("lime_500", LIME_500),
376        ("lime_600", LIME_600),
377        ("lime_700", LIME_700),
378        ("lime_800", LIME_800),
379        ("lime_900", LIME_900),
380        ("lime_a100", LIME_A100),
381        ("lime_a200", LIME_A200),
382        ("lime_a400", LIME_A400),
383        ("lime_a700", LIME_A700),
384        // yellows
385        ("yellow_50", YELLOW_50),
386        ("yellow_100", YELLOW_100),
387        ("yellow_200", YELLOW_200),
388        ("yellow_300", YELLOW_300),
389        ("yellow_400", YELLOW_400),
390        ("yellow_500", YELLOW_500),
391        ("yellow_600", YELLOW_600),
392        ("yellow_700", YELLOW_700),
393        ("yellow_800", YELLOW_800),
394        ("yellow_900", YELLOW_900),
395        ("yellow_a100", YELLOW_A100),
396        ("yellow_a200", YELLOW_A200),
397        ("yellow_a400", YELLOW_A400),
398        ("yellow_a700", YELLOW_A700),
399        // amber
400        ("amber_50", AMBER_50),
401        ("amber_100", AMBER_100),
402        ("amber_200", AMBER_200),
403        ("amber_300", AMBER_300),
404        ("amber_400", AMBER_400),
405        ("amber_500", AMBER_500),
406        ("amber_600", AMBER_600),
407        ("amber_700", AMBER_700),
408        ("amber_800", AMBER_800),
409        ("amber_900", AMBER_900),
410        ("amber_a100", AMBER_A100),
411        ("amber_a200", AMBER_A200),
412        ("amber_a400", AMBER_A400),
413        ("amber_a700", AMBER_A700),
414        // oranges
415        ("orange_50", ORANGE_50),
416        ("orange_100", ORANGE_100),
417        ("orange_200", ORANGE_200),
418        ("orange_300", ORANGE_300),
419        ("orange_400", ORANGE_400),
420        ("orange_500", ORANGE_500),
421        ("orange_600", ORANGE_600),
422        ("orange_700", ORANGE_700),
423        ("orange_800", ORANGE_800),
424        ("orange_900", ORANGE_900),
425        ("orange_a100", ORANGE_A100),
426        ("orange_a200", ORANGE_A200),
427        ("orange_a400", ORANGE_A400),
428        ("orange_a700", ORANGE_A700),
429        // deep oranges
430        ("deep_orange_50", DEEP_ORANGE_50),
431        ("deep_orange_100", DEEP_ORANGE_100),
432        ("deep_orange_200", DEEP_ORANGE_200),
433        ("deep_orange_300", DEEP_ORANGE_300),
434        ("deep_orange_400", DEEP_ORANGE_400),
435        ("deep_orange_500", DEEP_ORANGE_500),
436        ("deep_orange_600", DEEP_ORANGE_600),
437        ("deep_orange_700", DEEP_ORANGE_700),
438        ("deep_orange_800", DEEP_ORANGE_800),
439        ("deep_orange_900", DEEP_ORANGE_900),
440        ("deep_orange_a100", DEEP_ORANGE_A100),
441        ("deep_orange_a200", DEEP_ORANGE_A200),
442        ("deep_orange_a400", DEEP_ORANGE_A400),
443        ("deep_orange_a700", DEEP_ORANGE_A700),
444        // browns
445        ("brown_50", BROWN_50),
446        ("brown_100", BROWN_100),
447        ("brown_200", BROWN_200),
448        ("brown_300", BROWN_300),
449        ("brown_400", BROWN_400),
450        ("brown_500", BROWN_500),
451        ("brown_600", BROWN_600),
452        ("brown_700", BROWN_700),
453        ("brown_800", BROWN_800),
454        ("brown_900", BROWN_900),
455        // grey
456        ("grey_50", GREY_50),
457        ("grey_100", GREY_100),
458        ("grey_200", GREY_200),
459        ("grey_300", GREY_300),
460        ("grey_400", GREY_400),
461        ("grey_500", GREY_500),
462        ("grey_600", GREY_600),
463        ("grey_700", GREY_700),
464        ("grey_800", GREY_800),
465        ("grey_900", GREY_900),
466        // blue greys
467        ("blue_grey_50", BLUE_GREY_50),
468        ("blue_grey_100", BLUE_GREY_100),
469        ("blue_grey_200", BLUE_GREY_200),
470        ("blue_grey_300", BLUE_GREY_300),
471        ("blue_grey_400", BLUE_GREY_400),
472        ("blue_grey_500", BLUE_GREY_500),
473        ("blue_grey_600", BLUE_GREY_600),
474        ("blue_grey_700", BLUE_GREY_700),
475        ("blue_grey_800", BLUE_GREY_800),
476        ("blue_grey_900", BLUE_GREY_900),
477        // white and black
478        ("white", WHITE),
479        ("black", BLACK),
480    ];
481
482    /// <span style="color:#ffebee">&#9632;</span> (#ffebee)
483    pub const RED_50: HexColor = HexColor("#ffebee");
484    /// <span style="color:#ffcdd2">&#9632;</span> (#ffcdd2)
485    pub const RED_100: HexColor = HexColor("#ffcdd2");
486    /// <span style="color:#ef9a9a">&#9632;</span> (#ef9a9a)
487    pub const RED_200: HexColor = HexColor("#ef9a9a");
488    /// <span style="color:#e57373">&#9632;</span> (#e57373)
489    pub const RED_300: HexColor = HexColor("#e57373");
490    /// <span style="color:#ef5350">&#9632;</span> (#ef5350)
491    pub const RED_400: HexColor = HexColor("#ef5350");
492    /// <span style="color:#f44336">&#9632;</span> (#f44336)
493    pub const RED_500: HexColor = HexColor("#f44336");
494    /// <span style="color:#e53935">&#9632;</span> (#e53935)
495    pub const RED_600: HexColor = HexColor("#e53935");
496    /// <span style="color:#d32f2f">&#9632;</span> (#d32f2f)
497    pub const RED_700: HexColor = HexColor("#d32f2f");
498    /// <span style="color:#c62828">&#9632;</span> (#c62828)
499    pub const RED_800: HexColor = HexColor("#c62828");
500    /// <span style="color:#b71c1c">&#9632;</span> (#b71c1c)
501    pub const RED_900: HexColor = HexColor("#b71c1c");
502    /// <span style="color:#ff8a80">&#9632;</span> (#ff8a80)
503    pub const RED_A100: HexColor = HexColor("#ff8a80");
504    /// <span style="color:#ff5252">&#9632;</span> (#ff5252)
505    pub const RED_A200: HexColor = HexColor("#ff5252");
506    /// <span style="color:#ff1744">&#9632;</span> (#ff1744)
507    pub const RED_A400: HexColor = HexColor("#ff1744");
508    /// <span style="color:#d50000">&#9632;</span> (#d50000)
509    pub const RED_A700: HexColor = HexColor("#d50000");
510
511    /// <span style="color:#fce4ec">&#9632;</span> (#fce4ec)
512    pub const PINK_50: HexColor = HexColor("#fce4ec");
513    /// <span style="color:#f8bbd0">&#9632;</span> (#f8bbd0)
514    pub const PINK_100: HexColor = HexColor("#f8bbd0");
515    /// <span style="color:#f48fb1">&#9632;</span> (#f48fb1)
516    pub const PINK_200: HexColor = HexColor("#f48fb1");
517    /// <span style="color:#f06292">&#9632;</span> (#f06292)
518    pub const PINK_300: HexColor = HexColor("#f06292");
519    /// <span style="color:#ec407a">&#9632;</span> (#ec407a)
520    pub const PINK_400: HexColor = HexColor("#ec407a");
521    /// <span style="color:#e91e63">&#9632;</span> (#e91e63)
522    pub const PINK_500: HexColor = HexColor("#e91e63");
523    /// <span style="color:#d81b60">&#9632;</span> (#d81b60)
524    pub const PINK_600: HexColor = HexColor("#d81b60");
525    /// <span style="color:#c2185b">&#9632;</span> (#c2185b)
526    pub const PINK_700: HexColor = HexColor("#c2185b");
527    /// <span style="color:#ad1457">&#9632;</span> (#ad1457)
528    pub const PINK_800: HexColor = HexColor("#ad1457");
529    /// <span style="color:#880e4f">&#9632;</span> (#880e4f)
530    pub const PINK_900: HexColor = HexColor("#880e4f");
531    /// <span style="color:#ff80ab">&#9632;</span> (#ff80ab)
532    pub const PINK_A100: HexColor = HexColor("#ff80ab");
533    /// <span style="color:#ff4081">&#9632;</span> (#ff4081)
534    pub const PINK_A200: HexColor = HexColor("#ff4081");
535    /// <span style="color:#f50057">&#9632;</span> (#f50057)
536    pub const PINK_A400: HexColor = HexColor("#f50057");
537    /// <span style="color:#c51162">&#9632;</span> (#c51162)
538    pub const PINK_A700: HexColor = HexColor("#c51162");
539
540    /// <span style="color:#f3e5f5">&#9632;</span> (#f3e5f5)
541    pub const PURPLE_50: HexColor = HexColor("#f3e5f5");
542    /// <span style="color:#e1bee7">&#9632;</span> (#e1bee7)
543    pub const PURPLE_100: HexColor = HexColor("#e1bee7");
544    /// <span style="color:#ce93d8">&#9632;</span> (#ce93d8)
545    pub const PURPLE_200: HexColor = HexColor("#ce93d8");
546    /// <span style="color:#ba68c8">&#9632;</span> (#ba68c8)
547    pub const PURPLE_300: HexColor = HexColor("#ba68c8");
548    /// <span style="color:#ab47bc">&#9632;</span> (#ab47bc)
549    pub const PURPLE_400: HexColor = HexColor("#ab47bc");
550    /// <span style="color:#9c27b0">&#9632;</span> (#9c27b0)
551    pub const PURPLE_500: HexColor = HexColor("#9c27b0");
552    /// <span style="color:#8e24aa">&#9632;</span> (#8e24aa)
553    pub const PURPLE_600: HexColor = HexColor("#8e24aa");
554    /// <span style="color:#7b1fa2">&#9632;</span> (#7b1fa2)
555    pub const PURPLE_700: HexColor = HexColor("#7b1fa2");
556    /// <span style="color:#6a1b9a">&#9632;</span> (#6a1b9a)
557    pub const PURPLE_800: HexColor = HexColor("#6a1b9a");
558    /// <span style="color:#4a148c">&#9632;</span> (#4a148c)
559    pub const PURPLE_900: HexColor = HexColor("#4a148c");
560    /// <span style="color:#ea80fc">&#9632;</span> (#ea80fc)
561    pub const PURPLE_A100: HexColor = HexColor("#ea80fc");
562    /// <span style="color:#e040fb">&#9632;</span> (#e040fb)
563    pub const PURPLE_A200: HexColor = HexColor("#e040fb");
564    /// <span style="color:#d500f9">&#9632;</span> (#d500f9)
565    pub const PURPLE_A400: HexColor = HexColor("#d500f9");
566    /// <span style="color:#aa00ff">&#9632;</span> (#aa00ff)
567    pub const PURPLE_A700: HexColor = HexColor("#aa00ff");
568
569    /// <span style="color:#ede7f6">&#9632;</span> (#ede7f6)
570    pub const DEEP_PURPLE_50: HexColor = HexColor("#ede7f6");
571    /// <span style="color:#d1c4e9">&#9632;</span> (#d1c4e9)
572    pub const DEEP_PURPLE_100: HexColor = HexColor("#d1c4e9");
573    /// <span style="color:#b39ddb">&#9632;</span> (#b39ddb)
574    pub const DEEP_PURPLE_200: HexColor = HexColor("#b39ddb");
575    /// <span style="color:#9575cd">&#9632;</span> (#9575cd)
576    pub const DEEP_PURPLE_300: HexColor = HexColor("#9575cd");
577    /// <span style="color:#7e57c2">&#9632;</span> (#7e57c2)
578    pub const DEEP_PURPLE_400: HexColor = HexColor("#7e57c2");
579    /// <span style="color:#673ab7">&#9632;</span> (#673ab7)
580    pub const DEEP_PURPLE_500: HexColor = HexColor("#673ab7");
581    /// <span style="color:#5e35b1">&#9632;</span> (#5e35b1)
582    pub const DEEP_PURPLE_600: HexColor = HexColor("#5e35b1");
583    /// <span style="color:#512da8">&#9632;</span> (#512da8)
584    pub const DEEP_PURPLE_700: HexColor = HexColor("#512da8");
585    /// <span style="color:#4527a0">&#9632;</span> (#4527a0)
586    pub const DEEP_PURPLE_800: HexColor = HexColor("#4527a0");
587    /// <span style="color:#311b92">&#9632;</span> (#311b92)
588    pub const DEEP_PURPLE_900: HexColor = HexColor("#311b92");
589    /// <span style="color:#b388ff">&#9632;</span> (#b388ff)
590    pub const DEEP_PURPLE_A100: HexColor = HexColor("#b388ff");
591    /// <span style="color:#7c4dff">&#9632;</span> (#7c4dff)
592    pub const DEEP_PURPLE_A200: HexColor = HexColor("#7c4dff");
593    /// <span style="color:#651fff">&#9632;</span> (#651fff)
594    pub const DEEP_PURPLE_A400: HexColor = HexColor("#651fff");
595    /// <span style="color:#6200ea">&#9632;</span> (#6200ea)
596    pub const DEEP_PURPLE_A700: HexColor = HexColor("#6200ea");
597
598    /// <span style="color:#e8eaf6">&#9632;</span> (#e8eaf6)
599    pub const INDIGO_50: HexColor = HexColor("#e8eaf6");
600    /// <span style="color:#c5cae9">&#9632;</span> (#c5cae9)
601    pub const INDIGO_100: HexColor = HexColor("#c5cae9");
602    /// <span style="color:#9fa8da">&#9632;</span> (#9fa8da)
603    pub const INDIGO_200: HexColor = HexColor("#9fa8da");
604    /// <span style="color:#7986cb">&#9632;</span> (#7986cb)
605    pub const INDIGO_300: HexColor = HexColor("#7986cb");
606    /// <span style="color:#5c6bc0">&#9632;</span> (#5c6bc0)
607    pub const INDIGO_400: HexColor = HexColor("#5c6bc0");
608    /// <span style="color:#3f51b5">&#9632;</span> (#3f51b5)
609    pub const INDIGO_500: HexColor = HexColor("#3f51b5");
610    /// <span style="color:#3949ab">&#9632;</span> (#3949ab)
611    pub const INDIGO_600: HexColor = HexColor("#3949ab");
612    /// <span style="color:#303f9f">&#9632;</span> (#303f9f)
613    pub const INDIGO_700: HexColor = HexColor("#303f9f");
614    /// <span style="color:#283593">&#9632;</span> (#283593)
615    pub const INDIGO_800: HexColor = HexColor("#283593");
616    /// <span style="color:#1a237e">&#9632;</span> (#1a237e)
617    pub const INDIGO_900: HexColor = HexColor("#1a237e");
618    /// <span style="color:#8c9eff">&#9632;</span> (#8c9eff)
619    pub const INDIGO_A100: HexColor = HexColor("#8c9eff");
620    /// <span style="color:#536dfe">&#9632;</span> (#536dfe)
621    pub const INDIGO_A200: HexColor = HexColor("#536dfe");
622    /// <span style="color:#3d5afe">&#9632;</span> (#3d5afe)
623    pub const INDIGO_A400: HexColor = HexColor("#3d5afe");
624    /// <span style="color:#304ffe">&#9632;</span> (#304ffe)
625    pub const INDIGO_A700: HexColor = HexColor("#304ffe");
626
627    /// <span style="color:#e3f2fd">&#9632;</span> (#e3f2fd)
628    pub const BLUE_50: HexColor = HexColor("#e3f2fd");
629    /// <span style="color:#bbdefb">&#9632;</span> (#bbdefb)
630    pub const BLUE_100: HexColor = HexColor("#bbdefb");
631    /// <span style="color:#90caf9">&#9632;</span> (#90caf9)
632    pub const BLUE_200: HexColor = HexColor("#90caf9");
633    /// <span style="color:#64b5f6">&#9632;</span> (#64b5f6)
634    pub const BLUE_300: HexColor = HexColor("#64b5f6");
635    /// <span style="color:#42a5f5">&#9632;</span> (#42a5f5)
636    pub const BLUE_400: HexColor = HexColor("#42a5f5");
637    /// <span style="color:#2196f3">&#9632;</span> (#2196f3)
638    pub const BLUE_500: HexColor = HexColor("#2196f3");
639    /// <span style="color:#1e88e5">&#9632;</span> (#1e88e5)
640    pub const BLUE_600: HexColor = HexColor("#1e88e5");
641    /// <span style="color:#1976d2">&#9632;</span> (#1976d2)
642    pub const BLUE_700: HexColor = HexColor("#1976d2");
643    /// <span style="color:#1565c0">&#9632;</span> (#1565c0)
644    pub const BLUE_800: HexColor = HexColor("#1565c0");
645    /// <span style="color:#0d47a1">&#9632;</span> (#0d47a1)
646    pub const BLUE_900: HexColor = HexColor("#0d47a1");
647    /// <span style="color:#82b1ff">&#9632;</span> (#82b1ff)
648    pub const BLUE_A100: HexColor = HexColor("#82b1ff");
649    /// <span style="color:#448aff">&#9632;</span> (#448aff)
650    pub const BLUE_A200: HexColor = HexColor("#448aff");
651    /// <span style="color:#2979ff">&#9632;</span> (#2979ff)
652    pub const BLUE_A400: HexColor = HexColor("#2979ff");
653    /// <span style="color:#2962ff">&#9632;</span> (#2962ff)
654    pub const BLUE_A700: HexColor = HexColor("#2962ff");
655
656    /// <span style="color:#e1f5fe">&#9632;</span> (#e1f5fe)
657    pub const LIGHT_BLUE_50: HexColor = HexColor("#e1f5fe");
658    /// <span style="color:#b3e5fc">&#9632;</span> (#b3e5fc)
659    pub const LIGHT_BLUE_100: HexColor = HexColor("#b3e5fc");
660    /// <span style="color:#81d4fa">&#9632;</span> (#81d4fa)
661    pub const LIGHT_BLUE_200: HexColor = HexColor("#81d4fa");
662    /// <span style="color:#4fc3f7">&#9632;</span> (#4fc3f7)
663    pub const LIGHT_BLUE_300: HexColor = HexColor("#4fc3f7");
664    /// <span style="color:#29b6f6">&#9632;</span> (#29b6f6)
665    pub const LIGHT_BLUE_400: HexColor = HexColor("#29b6f6");
666    /// <span style="color:#03a9f4">&#9632;</span> (#03a9f4)
667    pub const LIGHT_BLUE_500: HexColor = HexColor("#03a9f4");
668    /// <span style="color:#039be5">&#9632;</span> (#039be5)
669    pub const LIGHT_BLUE_600: HexColor = HexColor("#039be5");
670    /// <span style="color:#0288d1">&#9632;</span> (#0288d1)
671    pub const LIGHT_BLUE_700: HexColor = HexColor("#0288d1");
672    /// <span style="color:#0277bd">&#9632;</span> (#0277bd)
673    pub const LIGHT_BLUE_800: HexColor = HexColor("#0277bd");
674    /// <span style="color:#01579b">&#9632;</span> (#01579b)
675    pub const LIGHT_BLUE_900: HexColor = HexColor("#01579b");
676    /// <span style="color:#80d8ff">&#9632;</span> (#80d8ff)
677    pub const LIGHT_BLUE_A100: HexColor = HexColor("#80d8ff");
678    /// <span style="color:#40c4ff">&#9632;</span> (#40c4ff)
679    pub const LIGHT_BLUE_A200: HexColor = HexColor("#40c4ff");
680    /// <span style="color:#00b0ff">&#9632;</span> (#00b0ff)
681    pub const LIGHT_BLUE_A400: HexColor = HexColor("#00b0ff");
682    /// <span style="color:#0091ea">&#9632;</span> (#0091ea)
683    pub const LIGHT_BLUE_A700: HexColor = HexColor("#0091ea");
684
685    /// <span style="color:#e0f7fa">&#9632;</span> (#e0f7fa)
686    pub const CYAN_50: HexColor = HexColor("#e0f7fa");
687    /// <span style="color:#b2ebf2">&#9632;</span> (#b2ebf2)
688    pub const CYAN_100: HexColor = HexColor("#b2ebf2");
689    /// <span style="color:#80deea">&#9632;</span> (#80deea)
690    pub const CYAN_200: HexColor = HexColor("#80deea");
691    /// <span style="color:#4dd0e1">&#9632;</span> (#4dd0e1)
692    pub const CYAN_300: HexColor = HexColor("#4dd0e1");
693    /// <span style="color:#26c6da">&#9632;</span> (#26c6da)
694    pub const CYAN_400: HexColor = HexColor("#26c6da");
695    /// <span style="color:#00bcd4">&#9632;</span> (#00bcd4)
696    pub const CYAN_500: HexColor = HexColor("#00bcd4");
697    /// <span style="color:#00acc1">&#9632;</span> (#00acc1)
698    pub const CYAN_600: HexColor = HexColor("#00acc1");
699    /// <span style="color:#0097a7">&#9632;</span> (#0097a7)
700    pub const CYAN_700: HexColor = HexColor("#0097a7");
701    /// <span style="color:#00838f">&#9632;</span> (#00838f)
702    pub const CYAN_800: HexColor = HexColor("#00838f");
703    /// <span style="color:#006064">&#9632;</span> (#006064)
704    pub const CYAN_900: HexColor = HexColor("#006064");
705    /// <span style="color:#84ffff">&#9632;</span> (#84ffff)
706    pub const CYAN_A100: HexColor = HexColor("#84ffff");
707    /// <span style="color:#18ffff">&#9632;</span> (#18ffff)
708    pub const CYAN_A200: HexColor = HexColor("#18ffff");
709    /// <span style="color:#00e5ff">&#9632;</span> (#00e5ff)
710    pub const CYAN_A400: HexColor = HexColor("#00e5ff");
711    /// <span style="color:#00b8d4">&#9632;</span> (#00b8d4)
712    pub const CYAN_A700: HexColor = HexColor("#00b8d4");
713
714    /// <span style="color:#e0f2f1">&#9632;</span> (#e0f2f1)
715    pub const TEAL_50: HexColor = HexColor("#e0f2f1");
716    /// <span style="color:#b2dfdb">&#9632;</span> (#b2dfdb)
717    pub const TEAL_100: HexColor = HexColor("#b2dfdb");
718    /// <span style="color:#80cbc4">&#9632;</span> (#80cbc4)
719    pub const TEAL_200: HexColor = HexColor("#80cbc4");
720    /// <span style="color:#4db6ac">&#9632;</span> (#4db6ac)
721    pub const TEAL_300: HexColor = HexColor("#4db6ac");
722    /// <span style="color:#26a69a">&#9632;</span> (#26a69a)
723    pub const TEAL_400: HexColor = HexColor("#26a69a");
724    /// <span style="color:#009688">&#9632;</span> (#009688)
725    pub const TEAL_500: HexColor = HexColor("#009688");
726    /// <span style="color:#00897b">&#9632;</span> (#00897b)
727    pub const TEAL_600: HexColor = HexColor("#00897b");
728    /// <span style="color:#00796b">&#9632;</span> (#00796b)
729    pub const TEAL_700: HexColor = HexColor("#00796b");
730    /// <span style="color:#00695c">&#9632;</span> (#00695c)
731    pub const TEAL_800: HexColor = HexColor("#00695c");
732    /// <span style="color:#004d40">&#9632;</span> (#004d40)
733    pub const TEAL_900: HexColor = HexColor("#004d40");
734    /// <span style="color:#a7ffeb">&#9632;</span> (#a7ffeb)
735    pub const TEAL_A100: HexColor = HexColor("#a7ffeb");
736    /// <span style="color:#64ffda">&#9632;</span> (#64ffda)
737    pub const TEAL_A200: HexColor = HexColor("#64ffda");
738    /// <span style="color:#1de9b6">&#9632;</span> (#1de9b6)
739    pub const TEAL_A400: HexColor = HexColor("#1de9b6");
740    /// <span style="color:#00bfa5">&#9632;</span> (#00bfa5)
741    pub const TEAL_A700: HexColor = HexColor("#00bfa5");
742
743    /// <span style="color:#e8f5e9">&#9632;</span> (#e8f5e9)
744    pub const GREEN_50: HexColor = HexColor("#e8f5e9");
745    /// <span style="color:#c8e6c9">&#9632;</span> (#c8e6c9)
746    pub const GREEN_100: HexColor = HexColor("#c8e6c9");
747    /// <span style="color:#a5d6a7">&#9632;</span> (#a5d6a7)
748    pub const GREEN_200: HexColor = HexColor("#a5d6a7");
749    /// <span style="color:#81c784">&#9632;</span> (#81c784)
750    pub const GREEN_300: HexColor = HexColor("#81c784");
751    /// <span style="color:#66bb6a">&#9632;</span> (#66bb6a)
752    pub const GREEN_400: HexColor = HexColor("#66bb6a");
753    /// <span style="color:#4caf50">&#9632;</span> (#4caf50)
754    pub const GREEN_500: HexColor = HexColor("#4caf50");
755    /// <span style="color:#43a047">&#9632;</span> (#43a047)
756    pub const GREEN_600: HexColor = HexColor("#43a047");
757    /// <span style="color:#388e3c">&#9632;</span> (#388e3c)
758    pub const GREEN_700: HexColor = HexColor("#388e3c");
759    /// <span style="color:#2e7d32">&#9632;</span> (#2e7d32)
760    pub const GREEN_800: HexColor = HexColor("#2e7d32");
761    /// <span style="color:#1b5e20">&#9632;</span> (#1b5e20)
762    pub const GREEN_900: HexColor = HexColor("#1b5e20");
763    /// <span style="color:#b9f6ca">&#9632;</span> (#b9f6ca)
764    pub const GREEN_A100: HexColor = HexColor("#b9f6ca");
765    /// <span style="color:#69f0ae">&#9632;</span> (#69f0ae)
766    pub const GREEN_A200: HexColor = HexColor("#69f0ae");
767    /// <span style="color:#00e676">&#9632;</span> (#00e676)
768    pub const GREEN_A400: HexColor = HexColor("#00e676");
769    /// <span style="color:#00c853">&#9632;</span> (#00c853)
770    pub const GREEN_A700: HexColor = HexColor("#00c853");
771
772    /// <span style="color:#f1f8e9">&#9632;</span> (#f1f8e9)
773    pub const LIGHT_GREEN_50: HexColor = HexColor("#f1f8e9");
774    /// <span style="color:#dcedc8">&#9632;</span> (#dcedc8)
775    pub const LIGHT_GREEN_100: HexColor = HexColor("#dcedc8");
776    /// <span style="color:#c5e1a5">&#9632;</span> (#c5e1a5)
777    pub const LIGHT_GREEN_200: HexColor = HexColor("#c5e1a5");
778    /// <span style="color:#aed581">&#9632;</span> (#aed581)
779    pub const LIGHT_GREEN_300: HexColor = HexColor("#aed581");
780    /// <span style="color:#9ccc65">&#9632;</span> (#9ccc65)
781    pub const LIGHT_GREEN_400: HexColor = HexColor("#9ccc65");
782    /// <span style="color:#8bc34a">&#9632;</span> (#8bc34a)
783    pub const LIGHT_GREEN_500: HexColor = HexColor("#8bc34a");
784    /// <span style="color:#7cb342">&#9632;</span> (#7cb342)
785    pub const LIGHT_GREEN_600: HexColor = HexColor("#7cb342");
786    /// <span style="color:#689f38">&#9632;</span> (#689f38)
787    pub const LIGHT_GREEN_700: HexColor = HexColor("#689f38");
788    /// <span style="color:#558b2f">&#9632;</span> (#558b2f)
789    pub const LIGHT_GREEN_800: HexColor = HexColor("#558b2f");
790    /// <span style="color:#33691e">&#9632;</span> (#33691e)
791    pub const LIGHT_GREEN_900: HexColor = HexColor("#33691e");
792    /// <span style="color:#ccff90">&#9632;</span> (#ccff90)
793    pub const LIGHT_GREEN_A100: HexColor = HexColor("#ccff90");
794    /// <span style="color:#b2ff59">&#9632;</span> (#b2ff59)
795    pub const LIGHT_GREEN_A200: HexColor = HexColor("#b2ff59");
796    /// <span style="color:#76ff03">&#9632;</span> (#76ff03)
797    pub const LIGHT_GREEN_A400: HexColor = HexColor("#76ff03");
798    /// <span style="color:#64dd17">&#9632;</span> (#64dd17)
799    pub const LIGHT_GREEN_A700: HexColor = HexColor("#64dd17");
800
801    /// <span style="color:#f9fbe7">&#9632;</span> (#f9fbe7)
802    pub const LIME_50: HexColor = HexColor("#f9fbe7");
803    /// <span style="color:#f0f4c3">&#9632;</span> (#f0f4c3)
804    pub const LIME_100: HexColor = HexColor("#f0f4c3");
805    /// <span style="color:#e6ee9c">&#9632;</span> (#e6ee9c)
806    pub const LIME_200: HexColor = HexColor("#e6ee9c");
807    /// <span style="color:#dce775">&#9632;</span> (#dce775)
808    pub const LIME_300: HexColor = HexColor("#dce775");
809    /// <span style="color:#d4e157">&#9632;</span> (#d4e157)
810    pub const LIME_400: HexColor = HexColor("#d4e157");
811    /// <span style="color:#cddc39">&#9632;</span> (#cddc39)
812    pub const LIME_500: HexColor = HexColor("#cddc39");
813    /// <span style="color:#c0ca33">&#9632;</span> (#c0ca33)
814    pub const LIME_600: HexColor = HexColor("#c0ca33");
815    /// <span style="color:#afb42b">&#9632;</span> (#afb42b)
816    pub const LIME_700: HexColor = HexColor("#afb42b");
817    /// <span style="color:#9e9d24">&#9632;</span> (#9e9d24)
818    pub const LIME_800: HexColor = HexColor("#9e9d24");
819    /// <span style="color:#827717">&#9632;</span> (#827717)
820    pub const LIME_900: HexColor = HexColor("#827717");
821    /// <span style="color:#f4ff81">&#9632;</span> (#f4ff81)
822    pub const LIME_A100: HexColor = HexColor("#f4ff81");
823    /// <span style="color:#eeff41">&#9632;</span> (#eeff41)
824    pub const LIME_A200: HexColor = HexColor("#eeff41");
825    /// <span style="color:#c6ff00">&#9632;</span> (#c6ff00)
826    pub const LIME_A400: HexColor = HexColor("#c6ff00");
827    /// <span style="color:#aeea00">&#9632;</span> (#aeea00)
828    pub const LIME_A700: HexColor = HexColor("#aeea00");
829
830    /// <span style="color:#fffde7">&#9632;</span> (#fffde7)
831    pub const YELLOW_50: HexColor = HexColor("#fffde7");
832    /// <span style="color:#fff9c4">&#9632;</span> (#fff9c4)
833    pub const YELLOW_100: HexColor = HexColor("#fff9c4");
834    /// <span style="color:#fff59d">&#9632;</span> (#fff59d)
835    pub const YELLOW_200: HexColor = HexColor("#fff59d");
836    /// <span style="color:#fff176">&#9632;</span> (#fff176)
837    pub const YELLOW_300: HexColor = HexColor("#fff176");
838    /// <span style="color:#ffee58">&#9632;</span> (#ffee58)
839    pub const YELLOW_400: HexColor = HexColor("#ffee58");
840    /// <span style="color:#ffeb3b">&#9632;</span> (#ffeb3b)
841    pub const YELLOW_500: HexColor = HexColor("#ffeb3b");
842    /// <span style="color:#fdd835">&#9632;</span> (#fdd835)
843    pub const YELLOW_600: HexColor = HexColor("#fdd835");
844    /// <span style="color:#fbc02d">&#9632;</span> (#fbc02d)
845    pub const YELLOW_700: HexColor = HexColor("#fbc02d");
846    /// <span style="color:#f9a825">&#9632;</span> (#f9a825)
847    pub const YELLOW_800: HexColor = HexColor("#f9a825");
848    /// <span style="color:#f57f17">&#9632;</span> (#f57f17)
849    pub const YELLOW_900: HexColor = HexColor("#f57f17");
850    /// <span style="color:#ffff8d">&#9632;</span> (#ffff8d)
851    pub const YELLOW_A100: HexColor = HexColor("#ffff8d");
852    /// <span style="color:#ffff00">&#9632;</span> (#ffff00)
853    pub const YELLOW_A200: HexColor = HexColor("#ffff00");
854    /// <span style="color:#ffea00">&#9632;</span> (#ffea00)
855    pub const YELLOW_A400: HexColor = HexColor("#ffea00");
856    /// <span style="color:#ffd600">&#9632;</span> (#ffd600)
857    pub const YELLOW_A700: HexColor = HexColor("#ffd600");
858
859    /// <span style="color:#fff8e1">&#9632;</span> (#fff8e1)
860    pub const AMBER_50: HexColor = HexColor("#fff8e1");
861    /// <span style="color:#ffecb3">&#9632;</span> (#ffecb3)
862    pub const AMBER_100: HexColor = HexColor("#ffecb3");
863    /// <span style="color:#ffe082">&#9632;</span> (#ffe082)
864    pub const AMBER_200: HexColor = HexColor("#ffe082");
865    /// <span style="color:#ffd54f">&#9632;</span> (#ffd54f)
866    pub const AMBER_300: HexColor = HexColor("#ffd54f");
867    /// <span style="color:#ffca28">&#9632;</span> (#ffca28)
868    pub const AMBER_400: HexColor = HexColor("#ffca28");
869    /// <span style="color:#ffc107">&#9632;</span> (#ffc107)
870    pub const AMBER_500: HexColor = HexColor("#ffc107");
871    /// <span style="color:#ffb300">&#9632;</span> (#ffb300)
872    pub const AMBER_600: HexColor = HexColor("#ffb300");
873    /// <span style="color:#ffa000">&#9632;</span> (#ffa000)
874    pub const AMBER_700: HexColor = HexColor("#ffa000");
875    /// <span style="color:#ff8f00">&#9632;</span> (#ff8f00)
876    pub const AMBER_800: HexColor = HexColor("#ff8f00");
877    /// <span style="color:#ff6f00">&#9632;</span> (#ff6f00)
878    pub const AMBER_900: HexColor = HexColor("#ff6f00");
879    /// <span style="color:#ffe57f">&#9632;</span> (#ffe57f)
880    pub const AMBER_A100: HexColor = HexColor("#ffe57f");
881    /// <span style="color:#ffd740">&#9632;</span> (#ffd740)
882    pub const AMBER_A200: HexColor = HexColor("#ffd740");
883    /// <span style="color:#ffc400">&#9632;</span> (#ffc400)
884    pub const AMBER_A400: HexColor = HexColor("#ffc400");
885    /// <span style="color:#ffab00">&#9632;</span> (#ffab00)
886    pub const AMBER_A700: HexColor = HexColor("#ffab00");
887
888    /// <span style="color:#fff3e0">&#9632;</span> (#fff3e0)
889    pub const ORANGE_50: HexColor = HexColor("#fff3e0");
890    /// <span style="color:#ffe0b2">&#9632;</span> (#ffe0b2)
891    pub const ORANGE_100: HexColor = HexColor("#ffe0b2");
892    /// <span style="color:#ffcc80">&#9632;</span> (#ffcc80)
893    pub const ORANGE_200: HexColor = HexColor("#ffcc80");
894    /// <span style="color:#ffb74d">&#9632;</span> (#ffb74d)
895    pub const ORANGE_300: HexColor = HexColor("#ffb74d");
896    /// <span style="color:#ffa726">&#9632;</span> (#ffa726)
897    pub const ORANGE_400: HexColor = HexColor("#ffa726");
898    /// <span style="color:#ff9800">&#9632;</span> (#ff9800)
899    pub const ORANGE_500: HexColor = HexColor("#ff9800");
900    /// <span style="color:#fb8c00">&#9632;</span> (#fb8c00)
901    pub const ORANGE_600: HexColor = HexColor("#fb8c00");
902    /// <span style="color:#f57c00">&#9632;</span> (#f57c00)
903    pub const ORANGE_700: HexColor = HexColor("#f57c00");
904    /// <span style="color:#ef6c00">&#9632;</span> (#ef6c00)
905    pub const ORANGE_800: HexColor = HexColor("#ef6c00");
906    /// <span style="color:#e65100">&#9632;</span> (#e65100)
907    pub const ORANGE_900: HexColor = HexColor("#e65100");
908    /// <span style="color:#ffd180">&#9632;</span> (#ffd180)
909    pub const ORANGE_A100: HexColor = HexColor("#ffd180");
910    /// <span style="color:#ffab40">&#9632;</span> (#ffab40)
911    pub const ORANGE_A200: HexColor = HexColor("#ffab40");
912    /// <span style="color:#ff9100">&#9632;</span> (#ff9100)
913    pub const ORANGE_A400: HexColor = HexColor("#ff9100");
914    /// <span style="color:#ff6d00">&#9632;</span> (#ff6d00)
915    pub const ORANGE_A700: HexColor = HexColor("#ff6d00");
916
917    /// <span style="color:#fbe9e7">&#9632;</span> (#fbe9e7)
918    pub const DEEP_ORANGE_50: HexColor = HexColor("#fbe9e7");
919    /// <span style="color:#ffccbc">&#9632;</span> (#ffccbc)
920    pub const DEEP_ORANGE_100: HexColor = HexColor("#ffccbc");
921    /// <span style="color:#ffab91">&#9632;</span> (#ffab91)
922    pub const DEEP_ORANGE_200: HexColor = HexColor("#ffab91");
923    /// <span style="color:#ff8a65">&#9632;</span> (#ff8a65)
924    pub const DEEP_ORANGE_300: HexColor = HexColor("#ff8a65");
925    /// <span style="color:#ff7043">&#9632;</span> (#ff7043)
926    pub const DEEP_ORANGE_400: HexColor = HexColor("#ff7043");
927    /// <span style="color:#ff5722">&#9632;</span> (#ff5722)
928    pub const DEEP_ORANGE_500: HexColor = HexColor("#ff5722");
929    /// <span style="color:#f4511e">&#9632;</span> (#f4511e)
930    pub const DEEP_ORANGE_600: HexColor = HexColor("#f4511e");
931    /// <span style="color:#e64a19">&#9632;</span> (#e64a19)
932    pub const DEEP_ORANGE_700: HexColor = HexColor("#e64a19");
933    /// <span style="color:#d84315">&#9632;</span> (#d84315)
934    pub const DEEP_ORANGE_800: HexColor = HexColor("#d84315");
935    /// <span style="color:#bf360c">&#9632;</span> (#bf360c)
936    pub const DEEP_ORANGE_900: HexColor = HexColor("#bf360c");
937    /// <span style="color:#ff9e80">&#9632;</span> (#ff9e80)
938    pub const DEEP_ORANGE_A100: HexColor = HexColor("#ff9e80");
939    /// <span style="color:#ff6e40">&#9632;</span> (#ff6e40)
940    pub const DEEP_ORANGE_A200: HexColor = HexColor("#ff6e40");
941    /// <span style="color:#ff3d00">&#9632;</span> (#ff3d00)
942    pub const DEEP_ORANGE_A400: HexColor = HexColor("#ff3d00");
943    /// <span style="color:#dd2c00">&#9632;</span> (#dd2c00)
944    pub const DEEP_ORANGE_A700: HexColor = HexColor("#dd2c00");
945
946    /// <span style="color:#efebe9">&#9632;</span> (#efebe9)
947    pub const BROWN_50: HexColor = HexColor("#efebe9");
948    /// <span style="color:#d7ccc8">&#9632;</span> (#d7ccc8)
949    pub const BROWN_100: HexColor = HexColor("#d7ccc8");
950    /// <span style="color:#bcaaa4">&#9632;</span> (#bcaaa4)
951    pub const BROWN_200: HexColor = HexColor("#bcaaa4");
952    /// <span style="color:#a1887f">&#9632;</span> (#a1887f)
953    pub const BROWN_300: HexColor = HexColor("#a1887f");
954    /// <span style="color:#8d6e63">&#9632;</span> (#8d6e63)
955    pub const BROWN_400: HexColor = HexColor("#8d6e63");
956    /// <span style="color:#795548">&#9632;</span> (#795548)
957    pub const BROWN_500: HexColor = HexColor("#795548");
958    /// <span style="color:#6d4c41">&#9632;</span> (#6d4c41)
959    pub const BROWN_600: HexColor = HexColor("#6d4c41");
960    /// <span style="color:#5d4037">&#9632;</span> (#5d4037)
961    pub const BROWN_700: HexColor = HexColor("#5d4037");
962    /// <span style="color:#4e342e">&#9632;</span> (#4e342e)
963    pub const BROWN_800: HexColor = HexColor("#4e342e");
964    /// <span style="color:#3e2723">&#9632;</span> (#3e2723)
965    pub const BROWN_900: HexColor = HexColor("#3e2723");
966
967    /// <span style="color:#fafafa">&#9632;</span> (#fafafa)
968    pub const GREY_50: HexColor = HexColor("#fafafa");
969    /// <span style="color:#f5f5f5">&#9632;</span> (#f5f5f5)
970    pub const GREY_100: HexColor = HexColor("#f5f5f5");
971    /// <span style="color:#eeeeee">&#9632;</span> (#eeeeee)
972    pub const GREY_200: HexColor = HexColor("#eeeeee");
973    /// <span style="color:#e0e0e0">&#9632;</span> (#e0e0e0)
974    pub const GREY_300: HexColor = HexColor("#e0e0e0");
975    /// <span style="color:#bdbdbd">&#9632;</span> (#bdbdbd)
976    pub const GREY_400: HexColor = HexColor("#bdbdbd");
977    /// <span style="color:#9e9e9e">&#9632;</span> (#9e9e9e)
978    pub const GREY_500: HexColor = HexColor("#9e9e9e");
979    /// <span style="color:#757575">&#9632;</span> (#757575)
980    pub const GREY_600: HexColor = HexColor("#757575");
981    /// <span style="color:#616161">&#9632;</span> (#616161)
982    pub const GREY_700: HexColor = HexColor("#616161");
983    /// <span style="color:#424242">&#9632;</span> (#424242)
984    pub const GREY_800: HexColor = HexColor("#424242");
985    /// <span style="color:#212121">&#9632;</span> (#212121)
986    pub const GREY_900: HexColor = HexColor("#212121");
987
988    /// <span style="color:#eceff1">&#9632;</span> (#eceff1)
989    pub const BLUE_GREY_50: HexColor = HexColor("#eceff1");
990    /// <span style="color:#cfd8dc">&#9632;</span> (#cfd8dc)
991    pub const BLUE_GREY_100: HexColor = HexColor("#cfd8dc");
992    /// <span style="color:#b0bec5">&#9632;</span> (#b0bec5)
993    pub const BLUE_GREY_200: HexColor = HexColor("#b0bec5");
994    /// <span style="color:#90a4ae">&#9632;</span> (#90a4ae)
995    pub const BLUE_GREY_300: HexColor = HexColor("#90a4ae");
996    /// <span style="color:#78909c">&#9632;</span> (#78909c)
997    pub const BLUE_GREY_400: HexColor = HexColor("#78909c");
998    /// <span style="color:#607d8b">&#9632;</span> (#607d8b)
999    pub const BLUE_GREY_500: HexColor = HexColor("#607d8b");
1000    /// <span style="color:#546e7a">&#9632;</span> (#546e7a)
1001    pub const BLUE_GREY_600: HexColor = HexColor("#546e7a");
1002    /// <span style="color:#455a64">&#9632;</span> (#455a64)
1003    pub const BLUE_GREY_700: HexColor = HexColor("#455a64");
1004    /// <span style="color:#37474f">&#9632;</span> (#37474f)
1005    pub const BLUE_GREY_800: HexColor = HexColor("#37474f");
1006    /// <span style="color:#263238">&#9632;</span> (#263238)
1007    pub const BLUE_GREY_900: HexColor = HexColor("#263238");
1008
1009    /// <span style="color:#000000">&#9632;</span> (#000000)
1010    pub const BLACK: HexColor = HexColor("#000000");
1011    /// <span style="color:#ffffff">&#9632;</span> (#ffffff)
1012    pub const WHITE: HexColor = HexColor("#ffffff");
1013
1014    #[cfg(test)]
1015    mod tests {
1016        use super::*;
1017        use pretty_assertions::assert_eq;
1018        use rstest::rstest;
1019
1020        #[rstest]
1021        #[case::valid_hex(Some(HexColor("#ff0000")), "#ff0000")]
1022        #[case::valid_name(Some(RED_500), "red_500")]
1023        #[case::invalid_name(None, "red_5")]
1024        #[case::invalid_hex(None, "#ff00g0")]
1025        #[case::invalid_hex_no_hash(None, "ff0000")]
1026        #[case::invalid_hex_too_short(None, "#ff00")]
1027        #[case::invalid_hex_too_long(None, "#ff00000")]
1028        #[case::invalid_hex_no_hash_too_short(None, "ff00")]
1029        #[case::invalid_hex_no_hash_too_long(None, "ff00000")]
1030        fn test_parse(#[case] expected: Option<HexColor>, #[case] input: &'static str) {
1031            let actual = HexColor::parse(input);
1032            assert_eq!(actual, expected);
1033        }
1034    }
1035}