docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ColorExtensions

    Extensions for working with colors.

    Inheritance
    object
    ColorExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public static class ColorExtensions

    Methods

    ArgbToRgbaHex(string)

    Convert a ARGB hex color to RGBA hex color.

    Declaration
    public static string ArgbToRgbaHex(string argbHex)
    Parameters
    Type Name Description
    string argbHex

    The ARGB hex color.

    Returns
    Type Description
    string

    The RGBA hex color if the string is a valid ARGB hex color, null otherwise.

    ColorToRgbaHex(Color)

    Convert a Color to a RGBA hex color.

    Declaration
    public static string ColorToRgbaHex(Color color)
    Parameters
    Type Name Description
    Color color

    The color to convert.

    Returns
    Type Description
    string

    The RGBA hex color.

    IsRgbHex(string)

    Check if a string is a valid RGB hex color.

    Declaration
    public static bool IsRgbHex(string hexColor)
    Parameters
    Type Name Description
    string hexColor

    The hex color to check.

    Returns
    Type Description
    bool

    True if the string is a valid RGB hex color.

    IsValidHex(string)

    Check if a string is a valid hex color.

    Declaration
    public static bool IsValidHex(string hexColor)
    Parameters
    Type Name Description
    string hexColor

    The hex color to check.

    Returns
    Type Description
    bool

    True if the string is a valid hex color.

    RgbaToArgbHex(string)

    Convert a RGBA hex color to ARGB hex color.

    Declaration
    public static string RgbaToArgbHex(string rgbaHex)
    Parameters
    Type Name Description
    string rgbaHex

    The RGBA hex color.

    Returns
    Type Description
    string

    The ARGB hex color if the string is a valid RGBA hex color, null otherwise.

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