# Black border with tikz shapes

I have a tikz triangle to which I am trying to add the border. For some reason, I see the black border on two sides but not on the third. Can you please help me figure out why?

Below is the MWE:

\documentclass{article}

\usepackage{etoolbox}
\usepackage{tikz}
\definecolor{mycolor}{RGB}{255,255,0}       % use mycolor to give a specific color to tikz

%\newrobustcmd*{\mytriangle}[1]{\tikz{\filldraw[draw=red,fill=#1] (0,0) --
%(0.2cm,0) -- (0.1cm,0.2cm);}}

\newrobustcmd*{\mytriangle}[1]{\tikz{\draw[thick, fill=mycolor] (0,0) -- (0.2cm,0) -- (0.1cm,0.2cm);}}

\begin{document}
\listoffigures

\section{Sample}
This is a triangle \mytriangle{mycolor}.

\begin{figure}[htp]
\centering
A figure
\caption{A triangle \mytriangle{mycolor}.}
\end{figure}

\end{document}


(0,0) -- (0.2cm,0) -- (0.1cm,0.2cm) -- cycle;