1function generateRandomColor() {
2 var letters = '0123456789ABCDEF';
3 var color = '#';
4 for (var i = 0; i < 6; i++) {
5 color += letters[Math.floor(Math.random() * 16)];
6 }
7 return color;
8}
9
10var randomColor=generateRandomColor();//"#F10531"
1var randomColor = '#'+Math.floor(Math.random()*16777215).toString(16);
2//generates a random color -> #56eec7
1var r = () => Math.random() * 256 >> 0;
2var color = `rgb(${r()}, ${r()}, ${r()})`;