pygame_sdl2 icon indicating copy to clipboard operation
pygame_sdl2 copied to clipboard

Document a means of efficient color swapping in 32-bit surfaces

Open pinobatch opened this issue 5 years ago • 0 comments

The file README.rst states:

Our thinking is that 8, 16, and (to some extent) 24-bit surfaces are legacy formats, and not worth duplicating code four or more times to support.

I agree with respect to 16- and 24-bit surfaces. But in my Pygame code, it has been an idiom to draw a single image several times with different colors by changing the palette between draw calls. For example, if three of 16 colors represent skin, and three other colors represent a character's uniform, I can draw two teams of light- and dark-skinned characters with one 8-bit sprite sheet and a variable palette. I'd appreciate it if the documentation mentioned a replacement technique suitable for use with the 32-bit surfaces of Pygame_SDL2.

pinobatch avatar Jan 18 '19 22:01 pinobatch