Negative Color Scheme

I’m making a game, and I want there to be an option in the settings to change the color scheme to a negative view, similar to if you press ctrl+option+command+8 on a mac. I was talking it over with my friend and the only thing we were able to figure out is to manually change the values. For example, if on the RGB spectrum the color was 0, 255, 0 then the negative color scheme would make it 255, 0, 255. Is there any simpler way to do this? Thanks for your help.

Do you just want a function for inverting colors? Or something else?

function InvertColor (color : Color) : Color {
	return Color (1.0-color.r, 1.0-color.g, 1.0-color.b);


var myColor =;
var myInvertedColor = InvertColor (myColor);

I thinks this way is better, more real.

 function InvertColor (color : Color) : Color {
              var maxColor = color.maxColorComponent
             return Color (maxColor-color.r, maxColor-color.g, maxColor-color.b);