#ansi-colors #terminal-console #terminal-colors #ansi-console

colorify

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

5 releases

Uses old Rust 2015

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

#14 in #ansi-console

Download history 145/week @ 2024-11-27 160/week @ 2024-12-04 161/week @ 2024-12-11 141/week @ 2024-12-18 104/week @ 2024-12-25 98/week @ 2025-01-01 134/week @ 2025-01-08 61/week @ 2025-01-15 53/week @ 2025-01-22 41/week @ 2025-01-29 103/week @ 2025-02-05 59/week @ 2025-02-12 87/week @ 2025-02-19 56/week @ 2025-02-26 38/week @ 2025-03-05 46/week @ 2025-03-12

235 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

Features