nmahesh567

Hi,


I have color as System.Drawing.Color c1 object as background color. Now I would like to get another System.Drawing.Color c2 object which is invert of c1 color to be used as foreground color.


e.g if I have c1 as black and I should get c2 as white.


Thanks,

Mahesh



Re: Windows Forms General Invert of background color

timvw


Code Snippet

static Color Inverse(Color color)
{
return Color.FromArgb(int.MaxValue - color.ToArgb());
}