docs.unity3d.com
    Show / Hide Table of Contents

    Class ColorExtensions

    Extensions for working with colors.

    Inheritance
    Object
    ColorExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    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
    Boolean

    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
    Boolean

    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023