\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[
ultra thick,
left/.tip={Rectangle[sep=0ptButt Cap[sep=0pt -1]Rectangle[sep=0pt -0.5, slant=-1 ,width=0pt 1, length=0pt 2]},
right/.tip={Rectangle[sep=0ptButt Cap[sep=0pt -1]Rectangle[sep=0pt -0.5, slant=1 ,width=0pt 1, length=0pt 2]},
]
\draw[line\draw[green, cap=rect]-right]
(0,0.5) edge[green, -right]- (0,1);
(0,1) edge[blue\draw[blue, left-right] (10,1)
-- (1,1) edge[yellow;
\draw[yellow, left-right] (1,01)
-- (1,0) edge[red;
\draw[red, left-] (1,0) -- (0.5,0);
\end{tikzpicture}
\end{document}
![Multi colored square](https://cdn.statically.io/img/i.sstatic.net/QsW4Ng7n.png)