colorparse

Crates.iocolorparse
lib.rscolorparse
version3.0.0
sourcesrc
created_at2016-06-21 23:40:30.524095
updated_at2022-08-17 14:35:35.835972
descriptionParse color configuration strings (in Git syntax) into ansi_term::Style objects.
homepagehttps://github.com/joshtriplett/colorparse
repositoryhttps://github.com/joshtriplett/colorparse
max_upload_size
id5450
size10,287
Josh Triplett (joshtriplett)

documentation

README

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();
Commit count: 13

cargo fmt