Created
July 1, 2015 14:48
-
-
Save dosjota/6da6f944d058b22248d9 to your computer and use it in GitHub Desktop.
Genera un color en hexadecimal de forma aleatoria
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 color = function() { | |
var hex = '0123456789ABCDEF', | |
color = '#'; | |
for (i=0;i<6;i++){ | |
color+=hex.charAt(parseInt(Math.floor(Math.random() * hex.length))); | |
} | |
return color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment