@UnstableApi
public final class ColorParser


Parser for color expressions found in styling formats, e.g. TTML and CSS.

See also:

Summary

Public methods

static @ColorInt int
parseCssColor(String colorExpression)

Parses a CSS color expression.

static @ColorInt int
parseTtmlColor(String colorExpression)

Parses a TTML color expression.

Public methods

parseCssColor

public static @ColorInt int parseCssColor(String colorExpression)

Parses a CSS color expression.

Parameters
String colorExpression

The color expression.

Returns
@ColorInt int

The parsed ARGB color.

parseTtmlColor

public static @ColorInt int parseTtmlColor(String colorExpression)

Parses a TTML color expression.

Parameters
String colorExpression

The color expression.

Returns
@ColorInt int

The parsed ARGB color.