I'm writing a program that take many sprites and put them together to make a final output as .png, the thing is each sprite have a rgba color associated with it to tint it.
I found someone repo that is very similar to what I'm doing but instead of exporting it as a png file he is using bevy to render it, and the result is what I'm expecting.
He is just passing the rgba color to bevy Sprite struct: https://docs.rs/bevy/0.8.1/bevy/prelude/struct.Sprite.html.
As the documentation say, the Color is "The sprite’s color tint".
I'm working with the image crate, and colorops does not provide any function for what I want. I have to write the function manually which is ok, but I have no idea what's the algorithm, how do I take 1 rgba pixel of my sprite and mix it with the other rbga to get the tint result I want, the result bevy get.
Despite all my effort looking through the repo of bevy, I couldn't find the algorithm.
So is there other crate maybe that provide such function, or what's the algorithm for it ?
Thank you