hexToRgb
Converts a hexadecimal string to RGB color.
Parameters
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
hex | string | false | The hexadecimal string to convert. |
Returns
Object { r: number, g: number, b: number }
Example
hexToRgb("ffffff"); // { r: 255, g: 255, b: 255 }
hexToRgb("#ffffff"); // { r: 255, g: 255, b: 255 }