Shaders and Color Replacement on a sprite!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By coco

Hello I’m pretty new using the engine.

I wanna change several colors on a specific sprite, something like:

if you find some pixels colored black, then replace it for red, and for the yellow then replace it for magenta(this is an example).

To replace one single color this code works:

vec4 current_pixel = texture(TEXTURE, UV);
if (current_pixel == origin)
    COLOR = new;
else
    COLOR = current_pixel; 

However I am able to only modify one single color.

What can I do if I want to modify several colors, since you can’t apply more than one shader.

Thank you

:bust_in_silhouette: Reply From: JimArtificer

Can you use else if?