Use
public Color Invert(Color inputColor)
{
byte r = (byte)~(inputCo lor.R);
byte g = (byte)~(inputCo lor.G);
byte b = (byte)~(inputCo lor.B);
return Color.FromArgb( inputColor.A, r, g, b);
}
WBR, Alex Meleta
Blog:
http://devkids.blogspot.com
-----Original Message-----
From:
ma************* *@gmail.com [mailto:ma****** ********@gmail. com]
Posted At: Donnerstag, 26. April 2007 21:37
Posted To: microsoft.publi c.dotnet.genera l
Conversation: Invert of background color
Subject: Invert of background color
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