The following code defines a MWE:

\documentclass[dvipsnames]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[dashed,Cerulean] (0,0)--(1,0)--(1,4);
\draw[thick,OrangeRed] (0,0) -- (1,4);
\draw[|-|] (1.3,4) -- (1.3,0) node[xshift=5ex,align=center,midway] {\scriptsize height (4)};
\draw[|-|] (0,-0.25) -- (1,-0.25) node[below,midway] {\scriptsize base (1)} ;
\end{tikzpicture}
\end{document}
The issue I have is that the shape is not a closed one and the corners where the hypotenuse and the other two sides meet are obviously unpleasant. Is there a way to have a closed path with different decorations and colors as in my example? Of course, much consideration needs to be given to the smoothness of the vertices.
