[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] How to replace a color in an image?



Okay, so I have an image with a transparent background (alpha
transparency), and several complex shapes, where each shape is made up
of a single color. I want to take a color from the image, and replace
it with a different color before drawing the image. So that, say, all
the complex shapes that are yellow will be drawn blue, by PyGame. I
don't think surface.fill will work, because the shapes are complex,
like I said, and not rectangles. I've also looked at surface.blit, but
can't seem to make anything work there, either... is this possible
using special_flags? I see there are flags like BLEND_RGB_ADD, but I
have no idea how to use those (and none of them seem to be about
actually replacing a color).

Any help is very much appreciated!