#terminal-colors #color #style #terminal #cli #chalk

lealang_chalk_rs

A crate which adds colors and styles to your terminal program

3 stable releases

1.2.0 Feb 9, 2025
1.1.1 Feb 7, 2025
1.1.0 Jan 30, 2025

#247 in Command-line interface

Download history 322/week @ 2025-01-27 708/week @ 2025-02-03 118/week @ 2025-02-10

1,148 downloads per month
Used in 2 crates (via lead_lang_interpreter)

Custom license

23KB
590 lines

Chalk

Video Demo

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!");

lib.rs:

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!");

Dependencies

~0–38MB
~473K SLoC