Published on January 26, 2024By DeveloperBreeze
function generateRandomColor() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
const randomColor = generateRandomColor();
console.log('Random Color:', randomColor);
Comments
Please log in to leave a comment.