Converts a hexadecimal color value to RGB in JavaScript