blockly > utils > colour > hexToRgb

utils.colour.hexToRgb() function

Converts a colour to RGB.

Signature:

export declare function hexToRgb(colour: string): number[];

Parameters

Parameter Type Description
colour string String representing colour in any colour format ('#ff0000', 'red', '0xff000', etc).

Returns:

number[]

RGB representation of the colour.