linebender / color

Color in Rust.
Apache License 2.0
32 stars 4 forks source link

Shorthand for discarding alpha #46

Open waywardmonkeys opened 3 hours ago

waywardmonkeys commented 3 hours ago

As I start to use the newly added color::palette::css code, I find that I'm often having to discard the alpha as I'm using OpaqueColor a lot.

I could do:

let (c, _) = color::palette::css::GOLDENROD.split();

But it would be nice for AlphaColor to have a const function for this like discard_alpha or to_opaque.

Either way, it isn't a big deal, just a small paper cut.

waywardmonkeys commented 3 hours ago

@raphlinus If you say "Yes", I'll submit the PR. If you say no, I'll close this issue. Or maybe there's another way to solve this.