colorize-rs 0.1.0

Simple terminal text colorisation using ansi characters
Documentation
  • Coverage
  • 50.54%
    47 out of 93 items documented0 out of 50 items with examples
  • Size
  • Source code size: 22.71 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.26 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MOBSkuchen

colorize-rs

A fork of colorize https://github.com/jeremyletang/colorize

colorize-rs provide simple text colorization for terminal emulator, using ansi escape characters.

colorize-rs is really simple to use, see this short example !

extern crate colorize_rs;
use colorize_rs::{AnsiColor, Color};

pub fn main() {
    // Set some global colors
    colorize_rs::global_fg(Color::Blue);
    colorize_rs::global_bg(Color::Red);
    // ^~~~ These settings are reset to default at the end.

    // You can use specific colors or style on a given str,
    // the globals colors are restored after !

    // Write a green underlined text on a yellow background !
    println!("{}", "Hello World !".green().underlined().yellowb());

    // Use bright or normal colors
    println!("{}", "Bright Green foreground and Magenta background !".b_green().magentab());
}