16 stable releases

2.2.0 Mar 18, 2024
2.1.1 Mar 17, 2024
2.0.0-beta.3 Feb 18, 2024
1.4.0 Feb 7, 2024
1.0.4 Oct 23, 2022

#25 in Text editors

Download history 10/week @ 2023-12-04 10/week @ 2023-12-11 201/week @ 2024-02-05 143/week @ 2024-02-12 174/week @ 2024-02-19 97/week @ 2024-02-26 219/week @ 2024-03-04 223/week @ 2024-03-11 233/week @ 2024-03-18

780 downloads per month
Used in catppuccin-whiskers

MIT license

140KB
628 lines

Logo
Catppuccin for Rust

Usage

Add Catppuccin to your project's Cargo.toml:

$ cargo add catppuccin

Example

struct Button {
    text: String,
    background_color: String,
};

fn confirm(text: String) -> Button {
    Button {
        text,
        background_color: catppuccin::PALETTE.mocha.colors.green.hex.to_string(),
    }
}

More examples can be found here.

Optional Features

ANSI string painting

Enable the ansi-term feature to add the Color::ansi_paint method. This adds ansi-term as a dependency.

Example: examples/term_grid.rs

CSS colors

Enable the css-colors feature to enable the conversion of Catppuccin colors to css_colors::RGB instances. This adds css-colors as a dependency.

Example: examples/css.rs

Ratatui

Enable the ratatui feature to enable the conversion of Catppuccin colors to ratatui::style::Color instances. This adds ratatui as a dependency.

Example: examples/ratatui.rs

Serde

Enable the serde feature to enable the serialization of Catppuccin's palette, flavor, and color types. This adds serde as a dependency.

Example: examples/serde.rs

Contributing

This project uses pre-commit to maintain consistent code style and standards.

See also CONTRIBUTING.md

💝 Thanks to

 

Copyright © 2021-present Catppuccin Org

Dependencies

~0.8–8.5MB
~49K SLoC