I am making a game that is done in 4 color monochrome, but I want to have a color mode. I am using shaders to recolor the sprites when this mode is enabled. For example, on a character, I will do a check to see if we are in the original monochrome mode, or in full color mode. If we are in the full color mode, I will use the shader to replace the colors in the sprite with other colors I have selected. It would still only be 4 colors, but each sprite could have any 4 colors I choose which would overall make the game more colorful.
I am wondering how to do this with my tiles. For example, imagine I have 4 tiles I am using in my tileset. The first tile is a tree top, the second tile is the tree trunk, the third tile is a patch of grass, and the fourth tile is a rock. When I recolor these, they would all need separate shaders, because the tree top would be shades of green, the tree trunk would be shades of brown, the grass might be other shades of green or it might use the same shader as the tree top, and the rock would be shades of gray.
I need to be able to change these in code, but I am not sure how to approach it. For example, can I separate them by layer and then change the shader on all tiles on that layer? Meaning everything that would use shader 1, goes on a certain layer in the tilemap and everything that would use shader 2 goes on another layer. I don’t think that works, but it is some idea of what I am looking to do.
How would you approach solving this?