Invert colours for a 2D sprite

Hello Everybody,

I searched a lot for a script which can invert the colours of my 2D sprites. I am knew to shaders and meshes so if anyone can explain a little bit and/or has a code for that I would be very grateful.

Thanks in advance.

Well, in the fragment shader instead of:

fixed4 col;
return col;

You’d do:

fixed4 col;
return fixed4(1.0-col.r, 1.0-col.g, 1.0-col.b, 1.0);

That’s it.