I have the following code which produces two queues. I would like to fill the first packet of the first queue with black (or any other color) and keep the second queue unfilled. Can I do this without changing a lot my code?
The code 1:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains,shapes.multipart}
\usetikzlibrary{shapes,calc,fit}
\usetikzlibrary{automata,positioning}
\tikzset{
queuei/.pic={
\draw[line width=1pt]
(0,0) -- ++(2cm,0) -- ++(0,-1cm) -- ++(-2cm,0);
\foreach \Val in {1,...,3}
\draw ([xshift=-\Val*10pt]2cm,0) -- ++(0,-1cm);
\node[above] at (1cm,0) {Queue $#1$};
},
}
\begin{document}
\begin{tikzpicture}[>=latex]
% the shapes
\path
(0,3cm) pic {queuei=1}
(0,1cm) pic {queuei=2};
\end{tikzpicture}
\end{document}


[pic actions]key to that rectangle. Then when you writepic[fill=red]it will be passed topic actions. But you need to modify creating the little box drawing accordingly maybe taking it out of for each loop and drawing explicitly. See the manual forpic actions– percusse Sep 20 '15 at 17:43