catppuccin-palette/rust/examples/term.rs

21 lines
586 B
Rust
Raw Normal View History

2022-10-23 17:33:09 +02:00
use catppuccin::flavours_iter;
fn main() {
// iterate over the four Catppuccin flavours.
for flavour in flavours_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.
2022-10-24 06:10:57 +02:00
for (i, colour) in flavour.palette().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!();
}
}