Version

IsSameColor Method

Determines if two colors are the same.
Syntax
'Declaration
 
Public Shared Function IsSameColor( _
   ByVal color1 As Color, _
   ByVal color2 As Color _
) As Boolean
public static bool IsSameColor( 
   Color color1,
   Color color2
)

Parameters

color1
The first System.Drawing.Color to compare.
color2
The System.Drawing.Color to compare against the first provided color.

Return Value

True if the colors are the same, false if they are not.
Remarks

The Equals method of the color object is restrictive in that a Named color will not equal an unnamed color even if their ARGB values are the same. This method is less restrictive and will return that such colors are the same.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also