What I would like to be able to do is dynamically change a solid single-colored png to another color simply by inputting the desired color code without losing the transparent background. The implementations I’ve seen tend to be a bit sloppy, so I was wondering if anyone can give me advice on how they would implement it.
I’d be most comfortable with a PHP solution but Python works too, hell I’ll even take a good canvas solution. Any advice/examples regarding this would be very much appreciated, thanks guys.
Ordinarily I like to work in the RGB color space, but this is a case where HLS works very well. The conversion in Python is simple, by replacing the H and S and leaving L the same.