0

I try to make a color gradient for a curve, with the same way as "left color=..., right color=..." for fill figures (but I want it just for a curve).

I found this way :

    \begin{tikzpicture}[
x={(-0.353553391cm,-0.353553391cm)},y={(1cm,0cm)},z={(0cm,1cm)},scale=1.5]
    \foreach \t in {0,0.015,...,0.8}{
    \definecolor{grayt}{rgb}{\t,\t,\t}
    \def\coeff{3.926990817}
    \draw[color=grayt] ({cos((\t-0.015)*\coeff r)},{sin(2*(\t-0.015)*\coeff r)},{0.05*(\t-0.015)*\coeff})--({cos(\t*\coeff r)},{sin(2*\t*\coeff r)},{0.05*\t*\coeff})--({cos((\t+0.015)*\coeff r)},{sin(2*(\t+0.015)*\coeff r)},{0.05*(\t+0.015)*\coeff});
    }
    \end{tikzpicture}

which makes the curve (cos(t),sin(2t),0.05t) for t \in [0,\pi], from black to light gray.

But does it exist a more simple way ? I would like to use a simple "plot".

Thanks!

rodak
  • 1

0 Answers0