Converts a color from CSS hex format to CSS rgb format.

Use in your code Learn more
bit import materialui.colors/convert/hex-to-rgb

convertHexToRGB (color:string) : string

Converts a color from CSS hex format to CSS rgb format.

Example

 convertHexToRGB('#9f3') // => 'rgb(153, 255, 51)'

Argument

color: string

Hex color, i.e. #nnn or #nnnnnn

Returns

string

A CSS rgb color string

Test Summary

convertHexToRGB converts a short hex color to an rgb color` Pass
convertHexToRGB converts a long hex color to an rgb color` Pass