<img id="espacio" src="https://raw.githubusercontent.com/NestorPlasencia/img/master/sala.png">
<input type="color" id="favcolor" value="#ff0000" onchange="cambiarcolor()" />
#espacio {
  width: 560px;
  display: block;
  margin: 0 auto;
  background-color: red;
}

#favcolor {
  display: block;
  margin: 0 auto;
}
function cambiarcolor() {
  let color = document.getElementById("favcolor").value;
  document.getElementById("espacio").style.backgroundColor = color;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.