Created
February 15, 2016 11:42
-
-
Save b4blue/dd7147f151df6de1d03e to your computer and use it in GitHub Desktop.
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
| public static function invertRgb(str:String):String { | |
| var hexArray:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); | |
| var colorBefore:String = str.toUpperCase(); | |
| var colorK:String; | |
| for (var n=0; n<6; n++) { | |
| var tempNum = colorBefore.substr(n, 1); | |
| for (var m=0; m<hexArray.length; m++) { | |
| if (tempNum == hexArray[m]) { | |
| var tempArray = hexArray.reverse(); | |
| tempNum = tempArray[m]; | |
| colorK += tempNum; | |
| } | |
| } | |
| } | |
| return colorK; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment