Created
June 22, 2014 12:03
-
-
Save fazlurr/f376f515432dc5b7248c to your computer and use it in GitHub Desktop.
Get Opposite Color - http://www.colortools.net/color_complementary.html
This file contains hidden or 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 opposite(c) { | |
| var result=''; | |
| var ch=''; | |
| var list1='0123456789ABCDEF'; | |
| var list2='FEDCBA9876543210'; | |
| for (var i=0; i<c.length; i++) { | |
| ch=c.charAt(i); | |
| for (var n=0; n<list1.length; n++) { | |
| if(ch==list1.charAt(n)) result += list2.charAt(n); | |
| } | |
| } | |
| return result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment