kornelski / rust-rgb

struct RGB for sharing pixels between crates
https://lib.rs/rgb
MIT License
97 stars 19 forks source link

Gain lose alpha #98

Closed ripytide closed 2 months ago

ripytide commented 2 months ago

To be reviewed after #97.

Adds a lot more flexibility to the GainAlpha and LoseAlpha.

The coolest part of this for me was changing the bound on the associated type of GainAlpha from type GainAlpha: HetPixel; to type GainAlpha: HasAlpha, that felt so cool and will actually be useful in generic functions for using methods from HasAlpha after calling a method on an impl GainAlpha type!

ripytide commented 2 months ago

Applied in #102