catppuccin-palette/rust/examples/term.rs

22 lines
591 B
Rust
Raw Normal View History

use catppuccin::Flavour;
2022-10-23 17:33:09 +02:00
fn main() {
// iterate over the four Catppuccin flavours.
for flavour in Flavour::into_iter() {
2022-10-24 06:10:57 +02:00
println!("{}", flavour.name());
2022-10-23 17:33:09 +02:00
// iterate over the 26 colours in the flavour.
for (i, colour) in flavour.palette().into_iter().enumerate() {
2022-10-23 17:33:09 +02:00
print!("{}", colour.ansi_paint("██"));
// the 14 analogous colours go on one line,
// then we break for the 12 monochromatic colours.
if i > 0 && i % 13 == 0 {
println!();
}
}
println!();
}
}