Created
September 7, 2015 17:01
-
-
Save sathvikc/64c51779b2ff1676c027 to your computer and use it in GitHub Desktop.
Random Colors using Java Script
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 getRandomColor() { | |
var letters = '0123456789ABCDEF'.split(''); | |
var color = '#'; | |
for (var i = 0; i < 6; i++ ) { | |
color += letters[Math.round(Math.random() * 15)]; | |
} | |
return color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment