I'm working on a document which is divided into chapters. Each chapter is divided into 4 sections. I would like to create a command that defines a color depending on the number of the section.
I've been trying to do so using ifthen package :
\usepackage{ifthen}
...
\newcommand{\myColor}{%
\ifthenelse{\thesection = 1}{DarkOrange}{%
\ifthenelse{\thesection = 2}{DeepSkyBlue}{%
\ifthenelse{\thesection = 3}{MediumSeaGreen}{%
DimGray}%
}%
}%
}%
I use titlesec to customize my section titles.
I get the following error :
Use of \@undeclaredcolor doesn't match its definition \section{exploration}
pointing to the line of my first section.
How could I correct this ?

\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}– azetina Aug 10 '14 at 16:11