Here is my problem:
I want to change the opacity of background-color of one of the elements on my page. in order to do this I need to first convert the color to rgb() fo
Use window.getComputedStyle(elem, null).getPropertyValue("background-color");
to get the background-color string. Then, check if it's in a desired format.
var name2rgb = {red: "rgb(255, 0, 0)"};
)A list of color names can be found on the web. Visit this site for a list of colornames (which is probably not complete).