Change the color of a 2D sprite using a shader

Hello all!

I have a 2D spritesheet. I have included it below. By using this spritesheet I am making a life line animation. What I need is, when the player’s health is under 25% the life line color will turn to orange.

Of course, I tried to change the color in the inspector, but the existing color (light green) mixes with the new color (orange) and create a completely new one. And definetely I do not want that.

So I think that the best way to solve this problem is to write a shader to turn the existing color to orange. Although, I have a big problem: I do not know how to write shaders. I tried to find some existing shaders in this Forum. I also tried to modify the standard shader, but none of the above worked.

I know that for someone who knows about shading and shaders it is pretty easy. I tried everything and anything I know, I aksed some friends of mine for help. I did a lot of research in the internet, but what I achived is to get more confused.

Can anyone here help me please???

Thank you for taking time reading my post!

Here is the spritesheet. Please note that it is transparent

3197037--244249--Health Line.png

Just make your lifeline texture white instead of green. Then tint the image as you previously had.

Hello! Thank you for your reply.
The problem is that the image has different colors not only one. So I can not just make it white.
Could you give me an alternative?

Make it greyscale then. Setting Image color will multiply on top and give you light/dark greens.