JavaScript
const ul = document.querySelector("#ul");
const cor = document.querySelectorAll(".cor");
ul.addEventListener("click", (event) => {
  const alvo = event.target;
  switch (alvo) {
    case cor[0] :
      ul.style.color = "red";
      break;
    case cor[1] :
      ul.style.color = "lime";
      break;
    case cor[2] :
      ul.style.color = "lightblue";
      break;
    case cor[3] :
      ul.style.color = "";
  }
});
HTML
<ul id="ul">
    <li class="cor">Cor vermelha</li>
    <li class="cor">Cor verde</li>
    <li class="cor">Cor azul</li>
    <li class="cor">RESET</li>
  </ul>

Clique os itens da lista.