{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class ColorEqualityComparer | Test Framework | 2.0.1-exp.2
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    ColorEqualityComparer
    Implements
    IEqualityComparer<Color>
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)