git_iris/theme/builtins/
mod.rs1use super::Theme;
4use super::loader::load_from_str;
5
6const SILKCIRCUIT_NEON_TOML: &str = include_str!("silkcircuit_neon.toml");
8const SILKCIRCUIT_SOFT_TOML: &str = include_str!("silkcircuit_soft.toml");
9const SILKCIRCUIT_GLOW_TOML: &str = include_str!("silkcircuit_glow.toml");
10const SILKCIRCUIT_VIBRANT_TOML: &str = include_str!("silkcircuit_vibrant.toml");
11const SILKCIRCUIT_DAWN_TOML: &str = include_str!("silkcircuit_dawn.toml");
12
13const CATPPUCCIN_MOCHA_TOML: &str = include_str!("catppuccin_mocha.toml");
15const DRACULA_TOML: &str = include_str!("dracula.toml");
16const NORD_TOML: &str = include_str!("nord.toml");
17const TOKYO_NIGHT_TOML: &str = include_str!("tokyo_night.toml");
18const GRUVBOX_DARK_TOML: &str = include_str!("gruvbox_dark.toml");
19const ONE_DARK_TOML: &str = include_str!("one_dark.toml");
20
21const CATPPUCCIN_LATTE_TOML: &str = include_str!("catppuccin_latte.toml");
23const SOLARIZED_LIGHT_TOML: &str = include_str!("solarized_light.toml");
24
25#[must_use]
31pub fn silkcircuit_neon() -> Theme {
32 load_from_str(SILKCIRCUIT_NEON_TOML, None)
33 .expect("builtin SilkCircuit Neon theme should be valid")
34}
35
36#[must_use]
38pub fn silkcircuit_soft() -> Theme {
39 load_from_str(SILKCIRCUIT_SOFT_TOML, None)
40 .expect("builtin SilkCircuit Soft theme should be valid")
41}
42
43#[must_use]
45pub fn silkcircuit_glow() -> Theme {
46 load_from_str(SILKCIRCUIT_GLOW_TOML, None)
47 .expect("builtin SilkCircuit Glow theme should be valid")
48}
49
50#[must_use]
52pub fn silkcircuit_vibrant() -> Theme {
53 load_from_str(SILKCIRCUIT_VIBRANT_TOML, None)
54 .expect("builtin SilkCircuit Vibrant theme should be valid")
55}
56
57#[must_use]
59pub fn silkcircuit_dawn() -> Theme {
60 load_from_str(SILKCIRCUIT_DAWN_TOML, None)
61 .expect("builtin SilkCircuit Dawn theme should be valid")
62}
63
64#[must_use]
70pub fn catppuccin_mocha() -> Theme {
71 load_from_str(CATPPUCCIN_MOCHA_TOML, None)
72 .expect("builtin Catppuccin Mocha theme should be valid")
73}
74
75#[must_use]
77pub fn dracula() -> Theme {
78 load_from_str(DRACULA_TOML, None).expect("builtin Dracula theme should be valid")
79}
80
81#[must_use]
83pub fn nord() -> Theme {
84 load_from_str(NORD_TOML, None).expect("builtin Nord theme should be valid")
85}
86
87#[must_use]
89pub fn tokyo_night() -> Theme {
90 load_from_str(TOKYO_NIGHT_TOML, None).expect("builtin Tokyo Night theme should be valid")
91}
92
93#[must_use]
95pub fn gruvbox_dark() -> Theme {
96 load_from_str(GRUVBOX_DARK_TOML, None).expect("builtin Gruvbox Dark theme should be valid")
97}
98
99#[must_use]
101pub fn one_dark() -> Theme {
102 load_from_str(ONE_DARK_TOML, None).expect("builtin One Dark theme should be valid")
103}
104
105#[must_use]
111pub fn catppuccin_latte() -> Theme {
112 load_from_str(CATPPUCCIN_LATTE_TOML, None)
113 .expect("builtin Catppuccin Latte theme should be valid")
114}
115
116#[must_use]
118pub fn solarized_light() -> Theme {
119 load_from_str(SOLARIZED_LIGHT_TOML, None)
120 .expect("builtin Solarized Light theme should be valid")
121}
122
123#[must_use]
129pub fn builtin_names() -> &'static [(&'static str, &'static str)] {
130 &[
131 ("silkcircuit-neon", "SilkCircuit Neon"),
133 ("silkcircuit-soft", "SilkCircuit Soft"),
134 ("silkcircuit-glow", "SilkCircuit Glow"),
135 ("silkcircuit-vibrant", "SilkCircuit Vibrant"),
136 ("silkcircuit-dawn", "SilkCircuit Dawn"),
137 ("catppuccin-mocha", "Catppuccin Mocha"),
139 ("dracula", "Dracula"),
140 ("nord", "Nord"),
141 ("tokyo-night", "Tokyo Night"),
142 ("gruvbox-dark", "Gruvbox Dark"),
143 ("one-dark", "One Dark"),
144 ("catppuccin-latte", "Catppuccin Latte"),
146 ("solarized-light", "Solarized Light"),
147 ]
148}
149
150#[must_use]
154pub fn load_by_name(name: &str) -> Option<Theme> {
155 match name {
156 "silkcircuit-neon" | "default" => Some(silkcircuit_neon()),
158 "silkcircuit-soft" => Some(silkcircuit_soft()),
159 "silkcircuit-glow" => Some(silkcircuit_glow()),
160 "silkcircuit-vibrant" => Some(silkcircuit_vibrant()),
161 "silkcircuit-dawn" => Some(silkcircuit_dawn()),
162 "catppuccin-mocha" => Some(catppuccin_mocha()),
164 "dracula" => Some(dracula()),
165 "nord" => Some(nord()),
166 "tokyo-night" => Some(tokyo_night()),
167 "gruvbox-dark" => Some(gruvbox_dark()),
168 "one-dark" => Some(one_dark()),
169 "catppuccin-latte" => Some(catppuccin_latte()),
171 "solarized-light" => Some(solarized_light()),
172 _ => None,
173 }
174}