Class ColorEqualityComparer
Use this class to compare two Color objects. ColorEqualityComparer.Instance has default calculation error value set to 0.01f. To set a test specific error value instantiate a comparer instance using the one argument constructor.
Implements
Inherited Members
Namespace: UnityEngine.TestTools.Utils
Assembly: solution.dll
Syntax
public class ColorEqualityComparer : IEqualityComparer<Color>
Constructors
Name | Description |
---|---|
ColorEqualityComparer(float) | Creates an instance of the comparer with a custom error value. |
Properties
Name | Description |
---|---|
Instance | A singleton instance of the comparer with a default error value set to 0.01f. |
Methods
Name | Description |
---|---|
Equals(Color, Color) | Compares the actual and expected Color objects for equality using AreFloatsEqualAbsoluteError(float, float, float) to compare the RGB and Alpha attributes of Color. Returns true if expected and actual objects are equal otherwise, it returns false. |
GetHashCode(Color) | Serves as the default hash function. |