A source code example and explanation about using palette swapping on a Sprite Sheet in Phaser 3.

Article by Richard Davey. Posted on 9th Aug 2018.   @photonstorm

image

Colbydude posted this example of using palette swapping on a spritesheet in Phaser 3:

"The palette swapping in this example is achieved by taking an image that contains palette data then going through a spritesheet and switching the matching pixels from the original palette to the new palette.

Our "palette data" image is a small image consisting of each unique color we want to replace and their replacements. Each color is a single pixel, and each row represents an individual palette."

Read More