Its simple, set the colour you dont want to be transparent, draw the sprite on a background of the colour you do want, and then grab the sprite again from where you drew it
I use this sort of thing alot in my own game engine
I use this sort of thing alot in my own game engine