Class ColorExtensions
Extensions for working with colors.
Inherited Members
Namespace: UnityEngine.Dt.App.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. |