Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Color.op_Equality Method

Tests whether two Color structures are exactly identical.

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

public static bool operator == (
	Color color1,
	Color color2
)
You cannot use methods in XAML.

Parameters

color1

The first Color structure to compare.

color2

The second Color structure to compare.

Return Value

true if color1 and color2 are exactly identical; 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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.