change const randomColor = `rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)})`; by using const max-color
const randomHex = ()=>{ let hex = Math.floor(Math.random() * 256).toString(16); if (hex.length < 2){ hex = `0${hex}`; } return hex; } const randomColor = ()=>{ const red = randomHex(); const green = randomHex(); const blue = randomHex(); return `#${red}${green}${blue}`; }