Code: Select all
\def\clr{ref}; % initial color
\def\count{0}; % counter
\foreach \col in {1,...,\numcols}
{
\foreach \row in {1,...,\numrows}
{
\pgfmathsetmacro{\count}{\count+1};
% calculate position and dimension of an ellipse
\ifthenelse{\count>6} {\def\clr{blue}} {};
\draw[fill=\clr] ..... % draw the ellipse
}
}
I cannot confirm that the value of \count is actually being updated by \pgfmathsetmacro.