/// <summary>
/// Calculates the opposite color
/// </summary>
/// <param name="clr">Given color</param>
/// <returns></returns>
public static Color CalculateOppositeColor(Color clr)
{
return Color.FromArgb(255 - clr.R, 255 - clr.G, 255 - clr.B);
}
Adsense
Tuesday, January 09, 2007
A function to calculate the opposite color of given color
at 13:26
Subscribe to:
Post Comments (Atom)
3 comments:
Thanks
yeh cheers for this!
Well, not a good idea. One can see it in some programs when the background is gray (128, 128, 128) - then the opposite color would be 127,127,127 - for the human eye is impossible to distinguish. The marker or selection box is lost agaist the gray background.
Post a Comment