I'm trying to make a document with multiple "themes." This involves changing the color of the headers, section names, and headers based on what the current section is. The colors I want to use are custom colors.
Now, I know how to make this the same for the whole document, but I was trying to find a way that would automatically change it automatically depending on the current section value. I thought that it would be really easy with the ifthen
package, as it seemed to be made for this (I could see if the section was equal to a value). However, it did not go as expected. I have a MWE below. Here I changed only the subsection name for clarity. I tried to make the subsections of Section One red and the subsections of Section Two blue. However, it seems like everything is blue. I did something similar for the header, but didn't go anywhere. Could anyone kindly point me in the right direction with this?
\documentclass[twoside]{article}
% For blind text
\usepackage[english]{babel}
\usepackage{blindtext}
% Here begins my attempt
\usepackage{ifthen}
\usepackage{titlesec}
% Coloring the section names (didn't mess with this, but I am using this as the basis of coloring the section and subsection names)
\titleformat{\section}{\LARGE\normalfont\center\color{blue}}{\thesection}{1em}{}
% My attempted ifthenelse statement. I put the if, then, and else arguments on different lines for clarity
\ifthenelse
{\equal{\thesection}{Section One}}
{\titleformat{\subsection}{\Large\normalfont\color{red}}{\thesubsection}{1em}{}}
{\titleformat{\subsection}{\Large\normalfont\color{blue}}{\thesubsection}{1em}{}}
% Sections begin on new page
\newcommand{\sectionbreak}{\clearpage}
% For headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[OR]{{\textsc{\leftmark}}\quad\quad\thepage}
\fancyhead[EL]{\thepage\quad\quad{\textsc{\leftmark}}}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
% For colors
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\begin{document}
\section{Section One}
\subsection{Subsection One}
\blindtext[5]
\subsection{Subsection Two}
\blindtext[5]
\section{Section Two}
\subsection{Subsection One}
\blindtext[5]
\subsection{Subsection Two}
\blindtext[5]
\end{document}