Skip to content

Instantly share code, notes, and snippets.

@ilhamarrouf
Created October 13, 2020 01:49
Show Gist options
  • Select an option

  • Save ilhamarrouf/341735ae4ffaba25767c6bb694b12538 to your computer and use it in GitHub Desktop.

Select an option

Save ilhamarrouf/341735ae4ffaba25767c6bb694b12538 to your computer and use it in GitHub Desktop.
Random Color Javascript
randomize() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment