I’m writing a game which has a basic sprite (a balloon) – currently I have 2 different color balloon PNG files which I have created, I need to create more (probably another 5 or so) and don’t want to have like 7 different png files. (that would be 20 extra files as I have 4 different sizes for scaling purposes) I would rather stick to 1 – the ones I have at the moment are yellow and red (almost solid, but not quite – they have details on them).
Question – is there a simple way to alter the colour of my existing PNG files? I’ve seen people mention setColor and setColorFilter but I can’t work out how to use these. Also will these even work on PNG files that already have a colour or do they only work on White PNG files (I don’t think my PNG’s can realistically be just white)?
Thank you all any help would be appreciated.
You can try to define a custom ColorMatrix with random r g b values:
I hope it helps.