Closed rafaelbeckel closed 1 year ago
Another thing to consider is to have an entirely different error type for rgba. I'm not sure how helpful it would be.
The tests should be fixed with #349, so you will have to rebase (or merge) this PR to get those changes here as well.
Anyway, I'm back from my adventures (some nice mountain hiking) and gave this another look. Apart from the error handling, I would suggest adding support for the 4 character shorthand format, too. It may not be as common, but I think it makes sense to at least be consistent with Rgb<S, u8>
in that way. But that would be all!
Another thing to consider is to have an entirely different error type for rgba. I'm not sure how helpful it would be.
I tried that, but it turned out to be too verbose, and the definitions became too far away from the usage. I decided to stick with a variant instead. It makes more sense semantically, too.
The code looks good and the tests are all green. 🙂 Thanks a lot!
bors r+
Build succeeded!
The publicly hosted instance of bors-ng is deprecated and will go away soon.
If you want to self-host your own instance, instructions are here. For more help, visit the forum.
If you want to switch to GitHub's built-in merge queue, visit their help page.
This change implements the from_str() trait for the Rgba type, adding support for parsing a RGBA hex string with the format
#rrggbbaa
.No related issue, no breaking changes.