docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetInstanceIdFromColor

    GetInstanceIdFromColor(Color32)

    Retrieve the ID associated with the passed in color. If the passed in color is black this service will return 0.

    Declaration
    public static uint GetInstanceIdFromColor(Color32 color)
    Parameters
    Type Name Description
    Color32 color

    The color to map to an ID.

    Returns
    Type Description
    uint

    The ID for the passed in color.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    Thrown if the passed in color is mapped to an ID that is greater than the largest supported ID

    InvalidOperationException

    Thrown if the passed in color cannot be mapped to an ID in the alpha 255 rangemaxId

    In This Article
    Back to top
    Copyright © 2024 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)