Twinside / Juicy.Pixels

Haskell library to load & save pictures
BSD 3-Clause "New" or "Revised" License
237 stars 57 forks source link

Why has TransparentPixel no setOpacity method? #132

Closed leftaroundabout closed 8 years ago

leftaroundabout commented 8 years ago

That class makes a lot of sense in that it FunDep-connects the RGBA-pixel variants with their respective RGB pendants. It would seem an obvious method for this class to have

setTransparency :: PixelBaseComponent a -> b -> a

with e.g.

setTransparency α (RGB8 r g b) = RGBA8 r g b α

is there a particular reason why this method isn't present?

Twinside commented 8 years ago

This typeclass was introduced while working on Rasterific, and I didn't need a setTransparency method for it. That's just it :]