Reputation: 883
I want a javascript function which will take a color name as parameter and it returns the color rgb code.
Upvotes: 0
Views: 1286
Reputation: 1188
You could set the style to a html element, let's say the <div id='d1'></div>
then you could check the computed color:
var d1 = document.getElementById('d1')
var color = window.getComputedStyle(d1, null)['color']
Upvotes: 1