TextStudioColorUtility
public static class TextStudioColorUtilityParses Text Studio color syntax and formats normalized hexadecimal color values.
Methods
Section titled “Methods”
TryParseColor(string, out Color32)
Section titled “TryParseColor(string, out Color32)”public static bool TryParseColor(string raw, out Color32 value)Parses quoted or unquoted named colors and 3, 4, 6, or 8 digit HTML hexadecimal colors.
Parameters
| Name | Type |
|---|---|
raw |
System.String |
value |
UnityEngine.Color32 |
Returns
System.Boolean
TryParseNamedColor(string, out Color32)
Section titled “TryParseNamedColor(string, out Color32)”public static bool TryParseNamedColor(string raw, out Color32 value)Parses a CSS-style named color while ignoring spaces, hyphens, underscores, and casing.
Parameters
| Name | Type |
|---|---|
raw |
System.String |
value |
UnityEngine.Color32 |
Returns
System.Boolean
ToHex(Color32)
Section titled “ToHex(Color32)”public static string ToHex(Color32 color)Formats uppercase RGB hexadecimal text, adding alpha only when it is not fully opaque.
Parameters
| Name | Type |
|---|---|
color |
UnityEngine.Color32 |
Returns
System.String