Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Color.Equals Method (Object)

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

Namespace: System.Windows.Media
Assembly: PresentationCore (in presentationcore.dll)

public override bool Equals (
	Object o
)
public boolean Equals (
	Object o
)
public override function Equals (
	o : Object
) : boolean
You cannot use methods in XAML.

Parameters

o

The Object to compare to this Color structure.

Return Value

true if o, the passed Object, is a Color structure and is identical to this Color structure; otherwise, false.

Floating point values can acquire a small degree of error when they are operated upon. The Equals method, the overloaded equality operator, and the overloaded inequality operator will will not compensate for this and thus may not return the expected boolean result.

The AreClose method uses a fuzzy equality algorithm that will compensate for this floating point arithmetic error by returning true for a comparison of two Color structures that are logically true, but whose values may differ by a miniscule amount.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2014 Microsoft