The color map allows the engine to better understand how to index sprite and tile map .pngs. Without a color map, the engine will automatically attempt to use the system colors as the index. This allows you to work with any set of colors you want when making your game’s artwork and then re-map them to the system’s default colors. Let’s take a look at the following few sprites and how their colors are indexed when imported:
Here you can see that these sprites are designed with four colors, not including the mask colors. They would work really well with a Game Boy color palette, but that system uses four shades of green:
To fix this, we can create a color map that has the native sprite colors in the same order as the system colors, like this:
Now when the sprites are loaded up in memory, they will automatically use the correct system colors:
Here is an example of the color mapper being turned on and off:
As a best practice, you should always design your sprites in shades of grey then include a color-map.png. That way, the engine knows how to correctly parse your sprite and tile map data since they both share the same graphic import parser.