I can't keep repeating the shape in the corners. I can't issue a command like corner of the corner. I want it to continue in a loop like fractal but I couldn't make the loop. With the command I wrote, the same shape is not drawn again on the small pink corners, can you help me?
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usepackage{caption}
\tikzset{
buffer/.style={
draw,
regular polygon,
regular polygon sides=4,
minimum size=20em
},
pics/nine/.style 2 args= {code={
\node[buffer, fill=#1] (A) {};
\foreach \mycorner in {1,2,3,4}
\node[buffer, fill=#2, scale=.33, transform canvas] at (A.corner \mycorner) {};
}},
}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\node[buffer, fill=pink] (B) {};
\foreach \mycorner in {1,2,3,4}
\pic[scale=.33, transform shape] at (B.corner \mycorner) {nine={green}{pink}};
\end{tikzpicture}
\caption{Number 4}
\end{figure}
\end{document}

