escapecolors

escapecolors is a rust crate that provides both a binary and a lib to escape colors from a string following ANSI SGR specifications.

Usage

As a binary:

echo -e '\E[31mhello\E[7;32min\E[0;4;44mcolors\E[0m' | escapecolors

As a lib:

``` use ansi_string::AnsiString;

fn main() { let byteswithcolors = vec![27,91,51,52,109,72,101,108,108,111,27,91,48,109]; let stringwithcolors = String::fromutf8(byteswithcolor).unwrap(); let ansistring = AnsiString::new(stringwithcolors); println!("Without colors: {}", ansistring.withoutcolors); println!("With colors: {}", ansi_string.original); } ```