Pavel_16, 
 этот полигон лучше убрать, его сложно обнаружить. 
<polygon points="131.69 367.997 131.69 367.997 131.69 367.997 131.69 367.997" fill="#ffffff"></polygon>
  
 
const elements = document.querySelectorAll("*[fill]");
    function handleClick () {
        const currentColor = document.querySelector(".palette-button-active");
        if (!currentColor) {
            alert("Цвет не выбран");
            return;
        }
        this.setAttribute("fill", currentColor.dataset.color);
        if ( [...elements].every(ep => ep.getAttribute('fill')!='#ffffff')) alert('Вы все закрасили!')
    }
	 |