Skip to main content
Version: 1.x

@microsoft/fast-colors > parseColorHexRGBA

parseColorHexRGBA() function

Converts a hexadecimal color string to a ColorRGBA64.

Signature:
export declare function parseColorHexRGBA(raw: string): ColorRGBA64 | null;

Parameters

ParameterTypeDescription
rawstringa color string in the form of "#RRGGBBAA" or "#RGBA"
Returns:

ColorRGBA64 | null

Example

parseColorHexRGBA("#FF0000AA");
parseColorHexRGBA("#F00A");