#ansi-term #style #git #color #colourparse

colorparse

Parse color configuration strings (in Git syntax) into ansi_term::Style objects

5 stable releases

Uses old Rust 2015

3.0.0 Aug 17, 2022
2.0.1 Oct 29, 2019
2.0.0 Sep 26, 2016
1.1.0 Aug 19, 2016
1.0.0 Jun 21, 2016

#79 in #ansi-term

25 downloads per month
Used in git-series

MIT/Apache

11KB
188 lines

Deprecation notice

I recommend using anstyle-git instead of this crate. colorparse works exclusively with ansi_term; anstyle-git and the anstyle family of crates provide an abstraction over several text formatting libraries.

colorparse

colorparse::parse parses a color configuration string (in Git syntax) into an ansi_term::Style:

Examples

if let Ok(color) = colorparse::parse("bold red blue") {
    println!("{}", color.paint("Bold red on blue"));
}
let hyperlink_style = colorparse::parse("#0000ee ul").unwrap();

lib.rs:

colorparse::parse parses a color configuration string (in Git syntax) into an ansi_term::Style:

Examples

 if let Ok(color) = colorparse::parse("bold red blue") {
     println!("{}", color.paint("Bold red on blue"));
 }

 let hyperlink_style = colorparse::parse("#0000ee ul").unwrap();

Dependencies

~240KB