Using the following jQuery will get the RGB value of an element\'s background color:
$(\'#selector\').css(\'backgroundColor\');
Is there a
Here's an ES6 one liner that doesn't use jQuery:
var rgb = document.querySelector('#selector').style['background-color']; return '#' + rgb.substr(4, rgb.indexOf(')') - 4).split(',').map((color) => parseInt(color).toString(16)).join('');