In my CSS file:
a, a:link, a:visited { color:#4188FB; }
a:active, a:focus, a:hover { color:#FFCC00; }
I tried with:
var lin
Here is my take. Simple and concise.
(function($) {
$.fn.getHexBackgroundColor = function() {
return (function(rgb) {
return '#' + (!rgb
? 'FFFFFF'
: rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/)
.slice(1)
.map(x => ('0' + parseInt(x).toString(16)).slice(-2))
.join('')
.toUpperCase());
})($(this).css('background-color'));
}
})(jQuery);
$(function() {
$('#color-rgb').text($('.foo').css('background-color'));
$('#color-hex').text($('.foo').getHexBackgroundColor());
});
.foo {
background: #F74;
width: 100px;
height: 100px;
}
label { font-weight: bold; }
label:after { content: ': '; }
UNDEF
UNDEF