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