I want to draw a gradient spiral with tikz and I am encountering problems. My current code:
\draw[line width=0.24mm, rotate=120, color=red] (0,0)
\foreach \i [evaluate={\r=(\i/1212)^2;}] in {0,5,...,545} {
-- (\i:\r)
};
I have seen that if I add a "[color=red!10]" before the last semicolon, it overrides the "color=red" of the first line. However, what I would like to do is to use the \i variable (or a formula including it) instead of the number 10, in something like this:
\draw[line width=0.24mm, rotate=120, color=red] (0,0)
\foreach \i [evaluate={\r=(\i/1212)^2;}] in {0,5,...,545} {
-- (\i:\r)
}[color=red!\i];
The problem is that the reference to "i" is outside the foreach loop, so I encounter a "! Missing number, treated as zero." error.
Is there any way I can use the "i" variable outside the loop? I've tried to define a variable inside the loop to use it outside with no success.
Any other way to draw a gradient spiral will be appreciated too.
Thanks!