Crate chalk_rs

Source
Expand description

A crate for terminal colors and styles

use chalk_rs::Chalk;

let mut chalk = Chalk::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: BasicChalk, AnsiChalk, and RgbChalk.

use chalk_rs::Chalk;


let mut chalk = Chalk::new();
chalk.ansi(56).println(&"Purple-ish");
chalk.rgb(25, 125, 63).println(&"This color is ugly");

Chalk can aldo do styling! Here’s an example:

use chalk_rs::Chalk;

let mut chalk = Chalk::new();
chalk.bold().println(&"Bold!");

Macros§

chalk_trait_fns
adds a set of functions to the trait
enum_default
Implements Default for an enum. Requires the enum to have a variant named “Default”
enum_display
Implements the Display trait for an enum. The output is the enum as a number
enum_fmt_impl
Implements a fmt trait for an enum. The output is the enum as a number
enum_impls
Implements several traits for a macro
fn_alias
Sets up an alias for a function
impl_enums
Implements several enums

Structs§

Chalk