OpenBve.TextureManager.InvertLightness C# (CSharp) Method

InvertLightness() private static method

private static InvertLightness ( int &R, int &G, int &B ) : void
R int
G int
B int
return void
		private static void InvertLightness(ref int R, ref int G, ref int B)
		{
			int nr, ng, nb;
			if (G <= R & R <= B | B <= R & R <= G)
			{
				nr = 255 + R - G - B;
				ng = 255 - B;
				nb = 255 - G;
			}
			else if (R <= G & G <= B | B <= G & G <= R)
			{
				nr = 255 - B;
				ng = 255 + G - R - B;
				nb = 255 - R;
			}
			else
			{
				nr = 255 - G;
				ng = 255 - R;
				nb = 255 + B - R - G;
			}
			R = nr;
			G = ng;
			B = nb;
		}