Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert Color Name
function convertColorName (name) {
var testEl = document.createElement('div'),
rgb; = name;
rgb = document.body.appendChild(testEl);
rgb = window.getComputedStyle(testEl).backgroundColor;
return rgb;
var salmon = converColorName('salmon');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.