Both the Equals method and the = operator check for known colours. The only
way to check colour equality in a numerical manner is to compare the RGB
value. Probably the easiest way is to convert to integer and compare those.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
[quoted text, click to view] "Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
news:%231rOinuLIHA.5400@TK2MSFTNGP04.phx.gbl...
> Is there a way to check whether two Colors are equal? If the Colors have
> different Name properties, the = operator will return false even if the
> A,R,G, and B properties are equal. I would like to be able to check
> whether two colors are equal based only on the properties that determine
> what color will be displayed. Is there a way to do this without writing my
> own method? Thanks.
> --
> Nathan Sokalski
> njsokalski@hotmail.com
>
http://www.nathansokalski.com/ >