function getRandomColor() {
const availableCharacters = '0123456789ABCDEF';
const availableCharacterLength = availableCharacters.length;
let color = '#';
for (let i = 0; i < 6; i++) {
color += availableCharacters[Math.floor(Math.random() * availableCharacterLength)];
}
return color;
}
console.log(getRandomColor()); // #3BB46D
function getRandomColor() {
const availableCharacters = '0123456789ABCDEF';
const availableCharacterLength = availableCharacters.length;
let color = '#';
for (let i = 0; i < 6; i++) {
color += availableCharacters[Math.floor(Math.random() * availableCharacterLength)];
}
return color;
}
function randomColor(e){return '#'+Math.round(Math.random()*0xffffff).toString(16);}
randomColor(/*idk*/)