chalk_rs

Crates.iochalk_rs
lib.rschalk_rs
version1.0.1
sourcesrc
created_at2020-05-06 23:28:23.752623
updated_at2020-05-20 15:15:39.425446
descriptionA crate which adds colors and styles to your terminal program
homepage
repositoryhttps://github.com/mrw1593/chalk_rs
max_upload_size
id238366
size27,372
Mica White (botahamec)

documentation

README

A crate for terminal colors and styles

use chalk_rs::prelude::*;
fn main() {
    let mut chalk = BasicChalk::new();
    chalk.red().println(&"This text is red");
    chalk.bold().println(&"Now it's red AND bold");
}

That's an example of basic color. There are three types of color in chalk: Basic, Ansi, and RGB.

use chalk_rs::prelude::*;

fn main() {
    let mut ansi = AnsiChalk::new();
    ansi.ansi(56).println(&"Purple-ish");
    let mut rgb = RgbChalk::new();
    rgb.rgb(25, 125, 63).println(&"This color is ugly");
}

RGB chalk is able to use ANSI and Basic color. ANSI chalk is able to use basic colors. However, ANSI chalk cannot use RGB and Basic chalk can't use RGB or ANSI.

use chalk_rs::prelude::*;

fn main() {
    let mut rgb = RgbChalk::new();
    rgb.ansi(56).println(&"Purple-ish");
    rgb.red().println(&"red");
}
Commit count: 119

cargo fmt