colorama

Crates.iocolorama
lib.rscolorama
version1.0.0
sourcesrc
created_at2023-05-08 18:55:54.899378
updated_at2024-03-02 08:46:56.959611
descriptionA simple way to colorize the output of your cli application.
homepagehttps://github.com/loenard97/colorama
repositoryhttps://github.com/loenard97/colorama
max_upload_size
id859994
size10,270
Dennis Lönard (loenard97)

documentation

README

colorama

A simple way to colorize the output of your cli application.

This crate contains a single trait Colored that is implemented for the String type. Calling .color("red"), .background("green") or .style("bold") will wrap your string with the corresponding ANSI escape sequence.

Different styles can be concatenated together:

use colorama::Colored;

let mut s = String::from("colorama");

s.color("red").background("green").style("bold");

println!("{}", s);

Unknown color / style names are silently ignored.

Note: This package does not check if the program is running inside a terminal or if it is called via pipes. If you want this functionality, check out termcolor, colored and / or atty.

Commit count: 2

cargo fmt