Do you want something like this?
\documentclass[a4paper]{article}
\usepackage{geometry,xcolor,pgffor}
\geometry{scale=1}
\definecolorseries{mycolours}{rgb}{last}[rgb]{1,1,1}[rgb]{1,0,0}
\resetcolorseries[98]{mycolours}
\begin{document}
\thispagestyle{empty}
\noindent\foreach \n in {1,...,98} {\color{mycolours!!+}\rule{30mm}{20mm}\hskip1pt}
\end{document}

\geometry{scale=1}
This is just setting the page margins etc. to zero for demonstration purposes i.e. so I can use the whole paper for the coloured rules.
\definecolorseries{mycolours}{rgb}{last}[rgb]{1,1,1}[rgb]{1,0,0}
This defines a colour series mycolours
using the colour model rgb
, method last
, 'base' (starting colour) [rgb]{1,1,1}
and 'step' (final colour in this case) [rgb]{1,0,0]
. Note this isn't the actual 'step', but the basis for calculating it according to method last
.
\resetcolorseries[98]{mycolours}
This calculates the 'step' between colours in the series, given that the series is to have 98
colours.
\noindent\foreach \n in {1,...,98} {\color{mycolours!!+}\rule{30mm}{20mm}\hskip1pt}
\color{mycolours!!+}
selects the current colour from series mycolours
and then increments the index so that on the next call, the next colour in the series will be used.
For further explanation, texdoc xcolor
can provide all the gory details of colour series, including the algorithms used to calculate the 'step' for each 'method' and the interpretation of the arguments passed to \definecolorseries
in each case. It also has lots of examples of colour series and information about calling the colours etc.
Or
\documentclass[a4paper]{article}
\usepackage{geometry,xcolor,pgffor}
\geometry{scale=1}
\definecolorseries{myreds}{rgb}{last}[rgb]{1,1,1}[rgb]{1,0,0}
\resetcolorseries[32]{myreds}
\definecolorseries{myblues}{rgb}{last}[rgb]{1,1,1}[rgb]{0,0,1}
\resetcolorseries[32]{myblues}
\definecolorseries{mygreens}{rgb}{last}[rgb]{1,1,1}[rgb]{0,1,0}
\resetcolorseries[32]{mygreens}
\pagestyle{empty}
\begin{document}
\noindent\foreach \n in {1,...,32} {\foreach \i in {myreds,myblues,mygreens}{\color{\i!!+}\rule{30mm}{20mm}\hskip1pt}}
\end{document}

\definecolorseries
and \resetcolorseries
are doing the same in this example as in the earlier one, but I'm putting 32
colours into each of 3 series, rather than 98
into just 1. Note that the key word last
in all 4 uses of \definecolorseries
tells you the 'method' used to calculate the 'step' is the same in each case.
xcolor
for information about colour series. – cfr Oct 25 '19 at 14:36