colorama 1.0.0

A simple way to colorize the output of your cli application.
Documentation
  • Coverage
  • 80%
    4 out of 5 items documented4 out of 5 items with examples
  • Size
  • Source code size: 9.93 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.23 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • loenard97/colorama
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • loenard97

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.