Skip to content

Instantly share code, notes, and snippets.

@gidili
Created July 24, 2015 09:04
Show Gist options
  • Save gidili/84fda0eb5258d08cf614 to your computer and use it in GitHub Desktop.
Save gidili/84fda0eb5258d08cf614 to your computer and use it in GitHub Desktop.
apply theme
function rgb2hex(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
function hex(x) {
return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
}
var hexDigits = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
$("*").each(function(){
if(rgb2hex($(this).css("color")) == "#fc6320")
$(this).css("color","#D6F729");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment