I'm using beamer
and I have a randomly colored grid (three colors, 4 x 19 grid) on the slides. Since I use the \pause
command, it generates a new grid every time I click to the next point. How do I force it to remember the first grid it generated? I know it should be something with redefining the color after the first generated grid (maybe \edef
?).
So this is my code for the grid:
\documentclass[a4paper,12pt]{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\pgfmathdeclarerandomlist{MyRandomColors}{%
{red}%
{blue}%
{green}%
}
\begin{document}
\begin{tikzpicture}[x=0.6cm,y=0.8cm]
\foreach \x in {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}
\foreach \y in {0,1,2,3}
{
\pgfmathrandomitem{\RandomColor}{MyRandomColors}
\draw[\RandomColor, fill=\RandomColor] (\x,\y) circle (0.2cm);
}
\end{tikzpicture}
\end{document}