Created
February 26, 2016 19:28
-
-
Save mateusvahl/fe92afc0109b5c1b9323 to your computer and use it in GitHub Desktop.
High Cotrast JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseBackground($element) { | |
var css = $element.css('background-color'); | |
if (!css || (css == 'rgba(0, 0, 0, 0)' || css == 'transparent')) { | |
return; | |
} | |
$element.css('background-color', 'black'); | |
} | |
function parseColor($element) { | |
$element.css('color', 'white'); | |
} | |
jQuery('body, body *:not("svg, svg *")').each(function(i, e) { | |
var pattern = /(rgba\(.*, 0\))/; | |
var $element = jQuery(this); | |
parseBackground($element); | |
parseColor($element); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment