Last active
August 29, 2015 14:14
-
-
Save devinrhode2/ac80d3e37732188fb457 to your computer and use it in GitHub Desktop.
modern js to inverse the colors for a textmate/sublime text .tmTheme file
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
// inverseA is the inverse function from this page but it only returns the newColor: http://www.webmasterorbit.com/rgb-hex-code.html | |
var text, node; | |
[].slice.call(document.getElementsByTagName('string')) | |
.forEach(function(node){ | |
text = node.innerText; | |
if ( text.indexOf('#') === 0 ) { | |
node.innerText = '#' + inverseA(text.substring(1, 7) ) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment