#colour #ansi-term #git #style #colourparse

archived 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

#19 in #ansi-term

Download history 20/week @ 2023-10-29 15/week @ 2023-11-05 16/week @ 2023-11-12 14/week @ 2023-11-19 30/week @ 2023-11-26 30/week @ 2023-12-03 9/week @ 2023-12-10 15/week @ 2023-12-17 25/week @ 2023-12-24 6/week @ 2023-12-31 15/week @ 2024-01-07 10/week @ 2024-01-14 11/week @ 2024-01-21 28/week @ 2024-01-28 24/week @ 2024-02-04 43/week @ 2024-02-11

108 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