[Tex/LaTex] Change color of enumerate item in block

#enumeratebeamerblockcoloretoolbox

basically, I'm trying to change the foreground color of enumerate items, subitems and subsubitems in the block environment in beamer.

In the following files, the line

\AtBeginEnvironment{block}{\setbeamercolor{enumerate item}{fg=esi-green}}

and their friends * should * make it work. Except, they dont… Please note that the lines affecting the foreground of of item within a itemize inside of a block work fine.I'm out of ideas to be honnest. The problem is most likely in the "Color theme" code sample, but I can't figure out where it is exactly and what I'm doing wrong.

Color theme

\usepackage{etoolbox}

\mode<presentation>

\definecolor{esi-red}{RGB}{176, 14, 43}
\definecolor{esi-blue}{RGB}{73, 143, 200}
\definecolor{esi-green}{RGB}{0, 166, 80}

\setbeamercolor{alerted text}{fg=esi-red}
\setbeamercolor{example text}{fg=esi-blue}

\AtBeginEnvironment{block}{\setbeamercolor{itemize item}{fg=esi-green}}
\AtBeginEnvironment{block}{\setbeamercolor{itemize subitem}{fg=esi-green}}
\AtBeginEnvironment{block}{\setbeamercolor{itemize subsubitem}{fg=esi-green}}
\AtBeginEnvironment{block}{\setbeamercolor{enumerate item}{fg=esi-green}}
\AtBeginEnvironment{block}{\setbeamercolor{enumerate subitem}{fg=esi-green}}
\AtBeginEnvironment{block}{\setbeamercolor{enumerate subsubitem}{fg=esi-green}}

\setbeamercolor*{palette primary}{fg=black, bg=esi-blue}
\setbeamercolor*{palette secondary}{fg=black, bg=esi-blue}
\setbeamercolor*{palette tertiary}{fg=esi-blue!30, bg=esi-red!80!black}
\setbeamercolor*{palette quaternary}{fg=black, bg=esi-blue!15}

\setbeamercolor*{upper separation line head left}{parent=palette tertiary}
\setbeamercolor*{upper separation line head right}{parent=palette primary}
\setbeamercolor{title}{fg=esi-red}
%\setbeamercolor*{titlelike}{fg=esi-red}
\setbeamercolor{frametitle}{fg=esi-red, bg=white}
\setbeamercolor{frametitle right}{bg=yellow!60!orange}
\setbeamercolor{structure}{fg=esi-blue}

\setbeamercolor{block title}{fg=white, bg=esi-green}
\setbeamercolor{block body}{fg=black, bg=esi-green!15}
\setbeamercolor{block title example}{fg=white, bg=esi-blue}
\setbeamercolor{block body example}{fg=black, bg=esi-blue!15}
\setbeamercolor{block title alerted}{fg=white, bg=esi-red}
\setbeamercolor{block body alerted}{fg=black, bg=esi-red!10}

\setbeamercolor*{separation line}{}
\setbeamercolor*{fine separation line}{}

\setbeamercolor*{sidebar}{fg=esi-red,bg=orange!75!white}

\setbeamercolor*{sidebar}{fg=esi-red,bg=orange!75!white}

\setbeamercolor*{palette sidebar primary}{fg=esi-red!10!black}
\setbeamercolor*{palette sidebar secondary}{fg=white}
\setbeamercolor*{palette sidebar tertiary}{fg=esi-red!50!black}
\setbeamercolor*{palette sidebar quaternary}{fg=yellow!10!orange}


\mode<all>

Outer theme

\newif\ifbeamer@ESI@navigation
\beamer@ESI@navigationfalse

\DeclareOptionBeamer{navigation}[true]{%
  \csname beamer@ESI@navigation#1\endcsname}

\ProcessOptionsBeamer


\mode<presentation>

\setbeamercolor*{author in head/foot}{parent=palette tertiary}
\setbeamercolor*{title in head/foot}{parent=palette secondary}
\setbeamercolor*{date in head/foot}{parent=palette primary}

\setbeamercolor*{section in head/foot}{parent=palette quaternary}
\setbeamercolor*{subsection in head/foot}{parent=palette primary}

\defbeamertemplate*{footline}{ESI theme}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.25\paperwidth,ht=2.25ex,dp=1ex,center]{%
      author in head/foot}%
    \usebeamerfont{author in head/foot}%
    \insertshortauthor~~\insertshortinstitute
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.45\paperwidth,ht=2.25ex,dp=1ex,center]{%
      title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.30\paperwidth,ht=2.25ex,dp=1ex,right]{%
      date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}

\defbeamertemplate*{headline}{ESI theme}
{
  \leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=.25\paperwidth,ht=1ex,dp=0ex]{%
        upper separation line head left}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.75\paperwidth,ht=1ex,dp=0ex]{%
        upper separation line head right}%
    \end{beamercolorbox}}%
  \vskip0pt
  \ifbeamer@ESI@navigation
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}%
  \begin{beamercolorbox}{section in head/foot}
    \vskip2pt\insertnavigation{\paperwidth}\vskip2pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}%
  \fi
}

\setbeamersize{text margin left=1em,text margin right=1em}

Theme

\mode<presentation>

\def\beamer@themeESI@navigation{}

\DeclareOptionBeamer{navigation}[true]{%
  \def\beamer@themeESI@navigation{#1}}

\ProcessOptionsBeamer

\useinnertheme{rectangles}
\usecolortheme{ESI}
\useoutertheme[navigation=\beamer@themeESI@navigation]{ESI}


\mode<all>

Document

\documentclass{beamer}

\mode<presentation>
\setbeamertemplate{footline}[frame number]
\setbeamercovered{transparent}
\usetheme{ESI}
\setbeamertemplate{frametitlecontinuation} {\insertcontinuationcount}

\begin{document}
\begin{frame}
\begin{block}
\begin{enumerate}
\item Level 1
    \begin{enumerate}
    \item Level 2
        \begin{enumerate}
        \item Level 3
        \end{enumerate}
    \end{enumerate}
\end{enumerate}
\end{block}
\end{frame}
\end{document}

Thanks for your answers.

Best Answer

To be honest, I don't understand the logic, but the square enumerate templates uses the item projected colour. If you add this to your colour theme you can change the enumerate item.

\documentclass{beamer}

\mode<presentation>
\setbeamertemplate{footline}[frame number]
\setbeamercovered{transparent}
\usetheme{ESI}
\setbeamertemplate{frametitlecontinuation} {\insertcontinuationcount}



\AtBeginEnvironment{block}{%
    \setbeamercolor{itemize item}{fg=esi-green}
    \setbeamercolor{itemize subitem}{fg=esi-green}
    \setbeamercolor{itemize subsubitem}{fg=esi-green}
    \setbeamercolor{enumerate item}{fg=esi-green, bg=red}
    \setbeamercolor{enumerate subitem}{fg=esi-green}
    \setbeamercolor{enumerate subsubitem}{fg=esi-green}
    \setbeamercolor{item projected}{fg=white, bg=esi-green}
}

\begin{document}
\begin{frame}
\begin{block}{titel}
\begin{enumerate}
\item Level 1
    \begin{enumerate}
    \item Level 2
        \begin{enumerate}
        \item Level 3
        \end{enumerate}
    \end{enumerate}
\end{enumerate}
\end{block}
\end{frame}
\end{document}

enter image description here