// about:blank const colour = (r, g, b) => `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}` const randomRgb = () => [0, 0, 0].map(() => Math.floor(Math.random() * 255)) // then run when you want a new colour document.body.style.backgroundColor = colour(...randomRgb()) // get the colour either through browser logs or via inspect element