[Tex/LaTex] Is it possible to create a custom color series in the xcolor package

color

I'm trying to make a color series with the xcolor package in order to carry out what I want in this question. However, it seems as though you can only choose a start and end color, and have a color gradation in between them. This does not leave any room for defining a completely custom color series where the colors don't have a particular order (if someone knows of a cool tool which can create a complicated gradation formula for any sequence of colors you throw to it, that would also be cool, but I think that's quite unlikely).

So I just want to know if there is a way to create a custom color sequence with my own colors. Or maybe if I can link together multiple bicolor sequences together to achieve something of this effect. It seems as though the perfect way I can create a color palette as per the linked question is by using this feature of xcolor – though unfortunately it seems to only work for colors which show a gradation, and doesn't let you define colors 1, 2, 3, etc. If anyone is interested, here is the documentation for xcolor's color series, on page 25. It doesn't seem to say anything about what I want.

Best Answer

Something like this if I understand correctly

enter image description here

\documentclass{article}

\usepackage{color}

\definecolor{zz0}{rgb}{.1,.8,.3}
\definecolor{zz1}{rgb}{.8,.2,.2}
\definecolor{zz2}{rgb}{.7,.9,.1}
\definecolor{zz3}{rgb}{.6,.4, 0}
\definecolor{zz4}{rgb}{.5,.1,.9}
\definecolor{zz5}{rgb}{.1, 0,.8}
\definecolor{zz6}{rgb}{.7,.2,.6}
\definecolor{zz7}{rgb}{.9,.3,.8}
\definecolor{zz8}{rgb}{0 ,.4,.1}
\definecolor{zz9}{rgb}{.7,.5,.2}
\definecolor{zz10}{rgb}{.1,.6,.3}
\definecolor{zz11}{rgb}{.6,.8,.5}

\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries\color{zz\arabic{section}}}}
\makeatother

\begin{document}

\section{Hmmmm}
zzz
\section{Hmmmm}
zzz
\section{Hmmmm}
zzz
\section{Hmmmm}
zzz
\section{Hmmmm}
zzz


\end{document}