\begin{tikzpicture}[scale=1.1]
\def\firstrectangle {(6,6) rectangle (4,4.5)};
\draw[color=black] (6,6) rectangle (5,5.5);
\draw[color=black] (6,5) rectangle (5,5.5);
\draw[color=black] (6,4.5) rectangle (5,5.5);
\draw[color=black] (4,6) rectangle (5,5.5);
\draw[color=black] (4,5) rectangle (5,5.5);
\draw[color=black] (4,4.5) rectangle (5,5.5);
\draw[black,|-|] (4,4,0) -- (6,4,0) node[midway,right] {};
\draw[black,|-|] (3.5,6,0) -- (3.5,4.5,0) node[midway,right] {};
\end{tikzpicture}
I need to fill each rectangle with a different color, keeping the black border of each rectangle. I do not know where to start.
![output.png[1]](../../images/a8c29ff328ed6f565584e853ec2f4cf6.webp)

filloption and a color of your choice as in\draw[color=black, fill=green]. – leandriis Feb 01 '20 at 21:49\draw[fill=green] ..... Default color of borders are black, so you need only definefillcolor of rectangles. – Zarko Dec 29 '22 at 08:04