pretty-easy-hex-to-rgb
Version:
Converts a hex color value to it's coresponding rgb value and returns it in an array like format of red, green, blue color values
13 lines (12 loc) • 435 B
TypeScript
/**
* @description
* Trims the string passed and checks if it's a valid HEX color value representation
* if it's not it will throw an Error and stop the execution
* else, it will make an rgb color value representation of the HEX color value passed
* and return the output in the Array like format
*
* @export
* @param {string} hex
* @returns {number[]}
*/
export declare function hexToRgb(hex: string): number[] | Error;