base16-palettes 0.1.0

A representation of the Base16 palettes in Rust
Documentation
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
#![allow(missing_docs)]

/// This module contains the color palettes that are supported by [base16](). These can be
/// converted into styles used by Ratatui.
mod default;
pub use default::*;

#[cfg(feature = "apprentice")]
mod apprentice;
#[cfg(feature = "apprentice")]
pub use apprentice::*;
#[cfg(feature = "atelier")]
mod atelier;
#[cfg(feature = "atelier")]
pub use atelier::*;
#[cfg(feature = "atlas")]
mod atlas;
#[cfg(feature = "atlas")]
pub use atlas::*;
#[cfg(feature = "black_metal")]
mod black_metal;
#[cfg(feature = "black_metal")]
pub use black_metal::*;
#[cfg(feature = "brogrammer")]
mod brogrammer;
#[cfg(feature = "brogrammer")]
pub use brogrammer::*;
#[cfg(feature = "brush_trees")]
mod brush_trees;
#[cfg(feature = "brush_trees")]
pub use brush_trees::*;
#[cfg(feature = "circus")]
mod circus;
#[cfg(feature = "circus")]
pub use circus::*;
#[cfg(feature = "classic")]
mod classic;
#[cfg(feature = "classic")]
pub use classic::*;
#[cfg(feature = "codeschool")]
mod codeschool;
#[cfg(feature = "codeschool")]
pub use codeschool::*;
#[cfg(feature = "colors")]
mod colors;
#[cfg(feature = "colors")]
pub use colors::*;
#[cfg(feature = "cupertino")]
mod cupertino;
#[cfg(feature = "cupertino")]
pub use cupertino::*;
#[cfg(feature = "danqing")]
mod danqing;
#[cfg(feature = "danqing")]
pub use danqing::*;
#[cfg(feature = "darcula")]
mod darcula;
#[cfg(feature = "darcula")]
pub use darcula::*;
#[cfg(feature = "darkviolet")]
mod darkviolet;
#[cfg(feature = "darkviolet")]
pub use darkviolet::*;
#[cfg(feature = "dracula")]
mod dracula;
#[cfg(feature = "dracula")]
pub use dracula::*;
#[cfg(feature = "equilibrium")]
mod equilibrium;
#[cfg(feature = "equilibrium")]
pub use equilibrium::*;
#[cfg(feature = "espresso")]
mod espresso;
#[cfg(feature = "espresso")]
pub use espresso::*;
#[cfg(feature = "eva")]
mod eva;
#[cfg(feature = "eva")]
pub use eva::*;
#[cfg(feature = "framer")]
mod framer;
#[cfg(feature = "framer")]
pub use framer::*;
#[cfg(feature = "fruit_soda")]
mod fruit_soda;
#[cfg(feature = "fruit_soda")]
pub use fruit_soda::*;
#[cfg(feature = "gigavolt")]
mod gigavolt;
#[cfg(feature = "gigavolt")]
pub use gigavolt::*;
#[cfg(feature = "github")]
mod github;
#[cfg(feature = "github")]
pub use github::*;
#[cfg(feature = "gruvbox")]
mod gruvbox;
#[cfg(feature = "gruvbox")]
pub use gruvbox::*;
#[cfg(feature = "hardcore")]
mod hardcore;
#[cfg(feature = "hardcore")]
pub use hardcore::*;
#[cfg(feature = "heetch")]
mod heetch;
#[cfg(feature = "heetch")]
pub use heetch::*;
#[cfg(feature = "helios")]
mod helios;
#[cfg(feature = "helios")]
pub use helios::*;
#[cfg(feature = "horizon")]
mod horizon;
#[cfg(feature = "horizon")]
pub use horizon::*;
#[cfg(feature = "humanoid")]
mod humanoid;
#[cfg(feature = "humanoid")]
pub use humanoid::*;
#[cfg(feature = "icy")]
mod icy;
#[cfg(feature = "icy")]
pub use icy::*;
#[cfg(feature = "kimber")]
mod kimber;
#[cfg(feature = "kimber")]
pub use kimber::*;
#[cfg(feature = "materia")]
mod materia;
#[cfg(feature = "materia")]
pub use materia::*;
#[cfg(feature = "material")]
mod material;
#[cfg(feature = "material")]
pub use material::*;
#[cfg(feature = "material_vivid")]
mod material_vivid;
#[cfg(feature = "material_vivid")]
pub use material_vivid::*;
#[cfg(feature = "mellow")]
mod mellow;
#[cfg(feature = "mellow")]
pub use mellow::*;
#[cfg(feature = "mexico_light")]
mod mexico_light;
#[cfg(feature = "mexico_light")]
pub use mexico_light::*;
#[cfg(feature = "nebula")]
mod nebula;
#[cfg(feature = "nebula")]
pub use nebula::*;
#[cfg(feature = "nord")]
mod nord;
#[cfg(feature = "nord")]
pub use nord::*;
#[cfg(feature = "nova")]
mod nova;
#[cfg(feature = "nova")]
pub use nova::*;
#[cfg(feature = "one_light")]
mod one_light;
#[cfg(feature = "one_light")]
pub use one_light::*;
#[cfg(feature = "onedark")]
mod onedark;
#[cfg(feature = "onedark")]
pub use onedark::*;
#[cfg(feature = "outrun")]
mod outrun;
#[cfg(feature = "outrun")]
pub use outrun::*;
#[cfg(feature = "papercolor")]
mod papercolor;
#[cfg(feature = "papercolor")]
pub use papercolor::*;
#[cfg(feature = "pasque")]
mod pasque;
#[cfg(feature = "pasque")]
pub use pasque::*;
#[cfg(feature = "pinky")]
mod pinky;
#[cfg(feature = "pinky")]
pub use pinky::*;
#[cfg(feature = "porple")]
mod porple;
#[cfg(feature = "porple")]
pub use porple::*;
#[cfg(feature = "purpledream")]
mod purpledream;
#[cfg(feature = "purpledream")]
pub use purpledream::*;
#[cfg(feature = "qualia")]
mod qualia;
#[cfg(feature = "qualia")]
pub use qualia::*;
#[cfg(feature = "rebecca")]
mod rebecca;
#[cfg(feature = "rebecca")]
pub use rebecca::*;
#[cfg(feature = "rose_pine")]
mod rose_pine;
#[cfg(feature = "rose_pine")]
pub use rose_pine::*;
#[cfg(feature = "sagelight")]
mod sagelight;
#[cfg(feature = "sagelight")]
pub use sagelight::*;
#[cfg(feature = "sakura")]
mod sakura;
#[cfg(feature = "sakura")]
pub use sakura::*;
#[cfg(feature = "sandcastle")]
mod sandcastle;
#[cfg(feature = "sandcastle")]
pub use sandcastle::*;
#[cfg(feature = "shades_of_purple")]
mod shades_of_purple;
#[cfg(feature = "shades_of_purple")]
pub use shades_of_purple::*;
#[cfg(feature = "silk")]
mod silk;
#[cfg(feature = "silk")]
pub use silk::*;
#[cfg(feature = "snazzy")]
mod snazzy;
#[cfg(feature = "snazzy")]
pub use snazzy::*;
#[cfg(feature = "solarflare")]
mod solarflare;
#[cfg(feature = "solarflare")]
pub use solarflare::*;
#[cfg(feature = "summercamp")]
mod summercamp;
#[cfg(feature = "summercamp")]
pub use summercamp::*;
#[cfg(feature = "summerfruit")]
mod summerfruit;
#[cfg(feature = "summerfruit")]
pub use summerfruit::*;
#[cfg(feature = "synth_midnight")]
mod synth_midnight;
#[cfg(feature = "synth_midnight")]
pub use synth_midnight::*;
#[cfg(feature = "tender")]
mod tender;
#[cfg(feature = "tender")]
pub use tender::*;
#[cfg(feature = "twilight")]
mod twilight;
#[cfg(feature = "twilight")]
pub use twilight::*;
#[cfg(feature = "unikitty")]
mod unikitty;
#[cfg(feature = "unikitty")]
pub use unikitty::*;
#[cfg(feature = "vice")]
mod vice;
#[cfg(feature = "vice")]
pub use vice::*;
#[cfg(feature = "windows")]
mod windows;
#[cfg(feature = "windows")]
pub use windows::*;
#[cfg(feature = "woodland")]
mod woodland;
#[cfg(feature = "woodland")]
pub use woodland::*;
#[cfg(feature = "xcode_dusk")]
mod xcode_dusk;
#[cfg(feature = "xcode_dusk")]
pub use xcode_dusk::*;
#[cfg(feature = "zenburn")]
mod zenburn;
#[cfg(feature = "zenburn")]
pub use zenburn::*;

pub(crate) use create::create_palette;

mod create {
    macro_rules! create_palette {
        ($name:ident,
        $s01:literal,
        $s02:literal,
        $s03:literal,
        $s04:literal,
        $s05:literal,
        $s06:literal,
        $s07:literal,
        $s08:literal,
        $s09:literal,
        $s10:literal,
        $s11:literal,
        $s12:literal,
        $s13:literal,
        $s14:literal,
        $s15:literal,
        $s16:literal,
        ) => {
            #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
            pub struct $name;

            impl crate::Base16Palette for $name {
                fn to_rgb(&self, color: crate::Base16Color) -> (u8, u8, u8) {
                    match color {
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Darkest,
                        )) => hex_literal::hex!($s01).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Darker,
                        )) => hex_literal::hex!($s02).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Lighter,
                        )) => hex_literal::hex!($s03).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Lightest,
                        )) => hex_literal::hex!($s04).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Darkest,
                        )) => hex_literal::hex!($s05).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Darker,
                        )) => hex_literal::hex!($s06).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Lighter,
                        )) => hex_literal::hex!($s07).into(),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Lightest,
                        )) => hex_literal::hex!($s08).into(),
                        crate::Base16Color::Accent(crate::Base16Accent::Accent00) => {
                            hex_literal::hex!($s09).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent01) => {
                            hex_literal::hex!($s10).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent02) => {
                            hex_literal::hex!($s11).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent03) => {
                            hex_literal::hex!($s12).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent04) => {
                            hex_literal::hex!($s13).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent05) => {
                            hex_literal::hex!($s14).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent06) => {
                            hex_literal::hex!($s15).into()
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent07) => {
                            hex_literal::hex!($s16).into()
                        }
                    }
                }

                fn to_hex_str(&self, color: crate::Base16Color) -> &'static str {
                    match color {
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Darkest,
                        )) => core::concat!("#", $s01),
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Darker,
                        )) => core::concat!("#", $s02),
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Lighter,
                        )) => core::concat!("#", $s03),
                        crate::Base16Color::Shade(crate::Base16Shade::Dark(
                            crate::Shade::Lightest,
                        )) => core::concat!("#", $s04),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Darkest,
                        )) => core::concat!("#", $s05),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Darker,
                        )) => core::concat!("#", $s06),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Lighter,
                        )) => core::concat!("#", $s07),
                        crate::Base16Color::Shade(crate::Base16Shade::Light(
                            crate::Shade::Lightest,
                        )) => core::concat!("#", $s08),
                        crate::Base16Color::Accent(crate::Base16Accent::Accent00) => {
                            core::concat!("#", $s09)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent01) => {
                            core::concat!("#", $s10)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent02) => {
                            core::concat!("#", $s11)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent03) => {
                            core::concat!("#", $s12)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent04) => {
                            core::concat!("#", $s13)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent05) => {
                            core::concat!("#", $s14)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent06) => {
                            core::concat!("#", $s15)
                        }
                        crate::Base16Color::Accent(crate::Base16Accent::Accent07) => {
                            core::concat!("#", $s16)
                        }
                    }
                }
            }
        };
    }

    pub(crate) use create_palette;
}