Skip to content

TextStudioColorUtility

ClassTextStudioTextStudio
public static class TextStudioColorUtility

Parses Text Studio color syntax and formats normalized hexadecimal color values.

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

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

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