I want to use \textcolor in the headings of my sections (see MWE below). My question differs to this question as I don't want to color all sections in one color (say red) and all subsections in another color (say green), but different sections in different colors.
\documentclass{beamer}
\usetheme{metropolis}
\begin{document}
\section{The \textcolor{red}{red} section}
\section{The \textcolor{green}{green} section}
\end{document}
