Last active
August 29, 2015 14:25
-
-
Save elliptic-shiho/b23c147a0155eca7c890 to your computer and use it in GitHub Desktop.
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
var r2a = function(x) { | |
return x.match(/#?([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2})/) | |
.map(function(a) { | |
return parseInt(a, 16); | |
}).splice(1); | |
}; | |
// r2a("#0c0c0c") -> [12, 12, 12] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment