I want to to several curves using foreach and PGFplots, but each curve witha different color. Here I present my code:
\def\R{1}
\begin{tikzpicture}
\begin{axis}[
xmin = -1.5, xmax = 1.5,
%axis x line*=middle,
ymin = -1.5, ymax = 1.5,
xtick distance = 1,
ytick distance = 1,
xlabel=$x$,
ylabel=$y$,
grid = both,
minor tick num = 2,
major grid style = {lightgray},
minor grid style = {lightgray!25},
width = 0.62\textwidth,
height = 0.62\textwidth]
\addplot[
domain = 0:2*pi,
samples = 200,
smooth,
thick,
] ({\R*sin(deg(x))},{\R*cos(deg(x))});
\foreach \r/\w in {0.1/10,0.2/20}{
\addplot[
domain = 0:2*pi,
samples = 200,
smooth,
thick,
color=red!\w!blue,
] ({(\R-\r)*cos(deg(x))+\r*cos(deg((\R-\r)*x/\r))},{(\R-\r)*sin(deg(x))-\r*sin(deg((\R-\r)*x/\r))});
}
\end{axis}
\end{tikzpicture}
However, Does not compile when I use \w in the color. Anyone can help me please?

