docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method HexToColor

    HexToColor(string)

    Converts an RGB or RGBA formatted hex string to a Color object.

    Declaration
    public static Color HexToColor(string hex)
    Parameters
    Type Name Description
    string hex

    The formatted string, with an optional "0x" or "#" prefix.

    Returns
    Type Description
    Color

    The color value represented by the formatted string.

    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)