1

This question already has an answer here:

The underlying square in the following code ends up green, and not blue as I was expecting.

Are there some rules to be aware of ?

\begin{tikzpicture}
\node (v1) at (0,3) {};
\node (v2) at (0,-1) {};
\node (v3) at (-3,3) {};
\node (v4) at (-3,-1) {};
\fill[color=gray!20]
(-3,-1) -- (-3,3) -- (0,3) -- (0,-1) -- cycle;
\fill[color=green!20]
(-3,-1) -- (-3,3) -- (0,3) -- (0,-1) -- cycle;
\fill[color=blue!20]
(v4) -- (v3) -- (v1) -- (v2) -- cycle;
\end{tikzpicture}

marked as duplicate by Heiko Oberdiek tikz-pgf Jun 17 '17 at 11:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.