I want to find out if a DOM Element has a style which is for example a color:Red. If this is defined on the inline style just like
Here is the library that will do it: Name That Color - http://chir.ag/projects/name-that-color/
Checkout this project https://github.com/evansque/coloraze and here is the node module for it https://www.npmjs.com/package/coloraze
Check out the https://www.w3schools.com/lib/w3color.js conversion script. It is very comprehensive, converting between named colors, hex, hsl, hwb, cmyk, and ncol
There's a sample function you could call in this answer:
Javascript function to convert color names to hex codes
It does a conversion from the name to the hex value.
A color name to RGB converter look up table will help, start here: http://web.njit.edu/~walsh/rgb.html.
On the other hand someone might have build it before, so try to google it: https://encrypted.google.com/search?num=100&q=SlateGray1+SlateGray2+inurl%3A.js
I think that these are the names supported in most browsers, you could store them in a dictionary and look them up: http://www.febooti.com/products/iezoom/online-help/html-color-names-x11-color-chart.html
The x11 color names are a superset of the ones defined in css.