Skip to content

Instantly share code, notes, and snippets.

@robinjl
Created November 27, 2019 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinjl/05084c00c56c8a06c3cc65138a369b24 to your computer and use it in GitHub Desktop.
Save robinjl/05084c00c56c8a06c3cc65138a369b24 to your computer and use it in GitHub Desktop.
generate random color from stackoverflow
function getRandomColor() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let 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