Trying to adapt this answer by percusse: https://tex.stackexchange.com/a/134297/3929 for a path that has a snake decoration.
It sort of works, but I'd like the curve to uniform thickness. In the image below it more or less looks like the the curve is drawn with a caligraphic pen.
Any ideas?
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{fadings}%
\usetikzlibrary{decorations.pathmorphing}
\begin{tikzfadingfrompicture}[name=custom fade]%
\path(-0.2cm,0.2cm) rectangle (1.2cm,2.5cm); % Arrow line is an overlay!
\pgfinterruptboundingbox
\draw[
very thick,
transparent!20,
decorate,decoration=snake,
line around/.style={
decoration={
pre=curveto,
pre length=0*#1,
post length=#1,
},
},
line around=3pt,
->] (0cm,0cm) -- ++ (0,2cm);
\endpgfinterruptboundingbox
\end{tikzfadingfrompicture}
\begin{document}
\begin{tikzpicture}
\draw[
draw=none,
path fading=custom fade,
top color=red,
bottom color=blue,
] (0,0) rectangle (1cm,-2cm);
\end{tikzpicture}
\end{document}

