Export (0) Print
Expand All

Color.Equals Method

Tests whether the specified object is a Color structure and is equivalent to this Color structure.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public override bool Equals(
	Object obj
)

Parameters

obj
Type: System.Object

The object to test.

Return Value

Type: System.Boolean
true if obj is a Color structure equivalent to this Color structure; otherwise, false.

This structure only does comparisons with other Color structures. To compare colors based solely on their ARGB values, you should use the ToArgb method. This is because the Equals and Equality members determine equivalency using more than just the ARGB value of the colors. For example, Black and FromArgb(0,0,0) are not considered equal, since Black is a named color and FromArgb(0,0,0) is not.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft