#color #terminal #ansi #console #format

colorify

Convenience macros for printing to the terminal in color on non-Windows platforms

5 releases

0.2.3 May 25, 2018
0.2.2 May 15, 2016
0.2.1 May 13, 2016
0.2.0 Mar 30, 2016
0.1.0 Mar 9, 2016

#130 in Command-line interface

Download history 115/week @ 2019-11-30 218/week @ 2019-12-07 86/week @ 2019-12-14 13/week @ 2019-12-21 18/week @ 2019-12-28 49/week @ 2020-01-04 55/week @ 2020-01-11 42/week @ 2020-01-18 14/week @ 2020-01-25 27/week @ 2020-02-01 18/week @ 2020-02-08 73/week @ 2020-02-15 68/week @ 2020-02-22 19/week @ 2020-02-29 26/week @ 2020-03-07 67/week @ 2020-03-14

341 downloads per month
Used in 6 crates

MIT license

11KB
138 lines

colorify!

Documentation

Handy macros for printing to the terminal in color.

Usage

Add the following to your Cargo.toml:

[dependencies]
colorify = "0.2"

Example

#[macro_use] extern crate colorify;
use std::io::{self, Write};

fn main() {
	// List colors:
	printc!(help);

	// Use one of three ways:
	printc!(yellow: "Number of banana peels on head: {}", 7);
	printlnc!(red: "Number of zombies killed: {}", 50);
	writeln!(io::stdout(), colorify!(orange: "Number of baggies filled \
		while walking dogs: {}"), 2).unwrap();
}

Retired

This library is unlikely to be updated with new features or changes.

Recommended alternatives:

No runtime deps