decentraland-ui
Version:
Decentraland's UI components and styles
15 lines (14 loc) • 452 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hex2rgb = void 0;
/**
* Converts an hexadecimal color into a RGB one.
* @param hex - A color represented as a 8 digits hexadecimal color.
*/
var hex2rgb = function (hex) {
var r = parseInt(hex.slice(1, 3), 16);
var g = parseInt(hex.slice(3, 5), 16);
var b = parseInt(hex.slice(5, 7), 16);
return { r: r, g: g, b: b };
};
exports.hex2rgb = hex2rgb;