@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
21 lines • 752 B
JavaScript
var NamedColorConverter = /** @class */ (function () {
function NamedColorConverter() {
}
NamedColorConverter.prototype.convert = function (colorName) {
if (window.getComputedStyle) {
var div = document.createElement("div");
div.style.color = colorName;
document.body.appendChild(div);
var result = window.getComputedStyle(div).color;
document.body.removeChild(div);
return result;
}
else {
console.warn("Unable to parse color with name " + colorName);
return null;
}
};
return NamedColorConverter;
}());
export { NamedColorConverter };
//# sourceMappingURL=NamedColorConverter.js.map