10 releases

0.2.0 Jun 15, 2021
0.1.9 Jun 14, 2021
0.1.8 May 28, 2021

#255 in Command-line interface

Download history 1/week @ 2022-04-16 12/week @ 2022-04-23 42/week @ 2022-04-30 60/week @ 2022-05-07 171/week @ 2022-05-14 31/week @ 2022-05-21 74/week @ 2022-05-28 61/week @ 2022-06-04 2/week @ 2022-06-18 12/week @ 2022-06-25 12/week @ 2022-07-02 22/week @ 2022-07-09 10/week @ 2022-07-16 21/week @ 2022-07-23 12/week @ 2022-07-30

65 downloads per month

MIT license

150KB
762 lines

Coloriz

Crates.io API Crates.io

Coloriz is a library for colorizing terminal outputs. It supports true colors and gradients.

You can easily make your terminal colorful!

Usage

Add this to your Cargo.toml :

[dependencies]
coloriz = "0.2.0"

Example

use coloriz::{Colorize, Color};

fn main() {
    let text = "Hello, world!";

    println!("{}{}", text.bg(Color::BrightRed), text.fg(Color::Red));
    println!("{}{}", text.fg(Color::Green), text.bg(Color::Green));
    println!("{}{}", text.bg(Color::BrightYellow), text.fg(Color::Yellow));
    println!("{}{}", text.fg(Color::BrightBlue), text.bg(Color::Blue));
    println!("{}{}", text.bg(Color::BrightMagenta), text.fg(Color::Magenta));
    println!("{}{}", text.fg(Color::BrightCyan), text.bg(Color::Cyan));
}

More examples

Todo

  • Document
  • More tests
  • Support Styles

Contributing

Contributions are welcome! Feel free to open Issues and PRs.

📃 License

MIT License

Copyright (c) 2021 navier

Dependencies