-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support parsing TrueColor
from RGB string
#123
Comments
It kind of looks like you're parsing a CSS color format into a BTW there are crates that handle the bulk of the work, like |
Problem
Currently the
from_str
function supports parsing color names toColor
enum based on the names. But this function does not parseTrueColor
.https://github.com/mackwic/colored/blob/11ffd20e7b5d1b48e4de7bb78ced26131ae5e114/src/color.rs#L88
Expectation
Given a string like
rgb(<u8>,<u8>,<u8>)
,from_str
should support parsing it to aColor::TrueColor
instance.Suggestion
In a project of mine, I've used a regex check to determine if the string matches the specific pattern and converts it to
Color::TrueColor
. A refined version of this could be added in the crate to be supported out-of-the-box.The text was updated successfully, but these errors were encountered: