Edit on
click anywhere
body {
  color: white;
  font-family: sans-serif;
}
let color = 0xFFFF00;

let toHex = (color) => 
  '#' + ('000000' + color.toString(16)).substr(-6);

function onClick() {
  color ^= 0xFFFFFF;
  document.body.style.background = toHex(color);
}

onClick();

document.addEventListener('click', onClick);


View Compiled
Rerun