How to make a texture only replace a certain color on a sprite?

How to make a texture only replace a certain color on a sprite?

I have a sprite that consist of the colors green(255) and red(255). I’ve been able to successfully make the texture replace the red color as intended but it seems the green color information is discarded.

Was hoping someone could explain how to include the green information in my material, and possibly how to make it a parameter.

Included are pictures of the material and sprite.

If you want to use green/red as a mask you will need to use lerps and plug the mask channel (red, or green) into the alpha input. To make a material a parameter, you simply right click the original material and choose to make it parameter. Keep in mind you must have parameter nodes in order to tweak it.

Thank you for steering me in the right direction. Although it’s a mess of wires but it works. I can now change the green color to whatever I like while applying a texture to the red.
8e9fc7b633da7f6e1de73b0596d5be78f002b84c.jpeg

Yeah lerps can get pretty messy. =P Glad you were able to resolve it.