# Use for cycle to print out color boxes

I'm trying to print out a series of colour boxes, using the wave option of xcolor.

The result should be a (long) series of color boxes (possibly, but not necessarily) on two columns, which differ from each other by a constant value (I mean whose whavelength is incremented by a constant value).

My proto-code currently looks like:

 \documentclass{article}
\usepackage{xcolor}
\begin{document}
\colorbox[wave]{363}{ \ \strut   } 363\\
\colorbox[wave]{368}{ \ \strut   } 368\\

...
\end{document}


But I was tired before reaching the end of the spectrum.

How is it possible to obtain the result in which the wavelength (and the number printed afterwards) are discretely incremented (and whose increment is configurable?

Thanks.

Just to clarify: this question is about loops, not colors per se: I'm fine with the output of xcolor

\documentclass{article}

• if you are not drawing then \usepackage{pgffor} is enough. Otherwise TikZ already loads xcolor – percusse Mar 30 '17 at 10:07