const ul = document.querySelector("#ul");
const cor = document.querySelectorAll(".cor");
cor[0].addEventListener("click", () => {
ul.style.color = "red";
});
cor[1].addEventListener("click", () => {
ul.style.color = "lime";
});
cor[2].addEventListener("click", () => {
ul.style.color = "lightblue";
});
cor[3].addEventListener("click", () => {
ul.style.color = "";
});
<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.