# How to draw a double-color line with TikZ? [duplicate]

I would like to draw lines which have two colors along the complete length. In principle I could draw two lines next to each other which are slightly shifted, however, this seems like a whole lot of fiddling with coordinates to get everything right. Is there some generic way to do this, or has somebody already written something like this and made it so that it is portable?

A short example:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node [circle,fill] (e0) at (5,1.5) {};
\node [circle,fill] (e1) at (0,0) {};
\node [circle,fill] (e2) at (10,0) {};
\node [circle,fill] (e4) at (5,3.5) {};
\draw [ultra thick, blue] (e1) to  (e2);
\draw [ultra thick, green] (e1) to (e4);
\draw [ultra thick, blue](e1) to (e4);
\draw [ultra thick, blue] (e2) to (e4);
\draw (e1) to (e2);
\draw [ultra thick, green] (e0) to (e1);
\draw (e0) to (e2);
\draw [ultra thick, green] (e0) to (e4);
\end{tikzpicture}
\end{document}


I would like the edge from e1 to e4 to be green and blue, with the green line running along the inside of the triangle and the blue line along the outside of the triangle.