[Tex/LaTex] Different colors for itemize in blocks and outside, in Beamer

beamercolor

I would like to obtain what I describe in the following MWE, that is the itemize symbol should be

  • black outside blocks;
  • blue in normal blocks;
  • red in alert blocks;
  • green in example blocks.

MWE:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize} 
\item Here in blue, I'd like it in black. 
\end{itemize}
\begin{block}{A block}
  \begin{itemize} 
  \item Here in blue, I'd like keep it in blue. 
  \end{itemize}
\end{block}
\begin{alertblock}{An alert block}
  \begin{itemize} 
  \item Here in red, I'd like keep it in red. 
  \end{itemize}
\end{alertblock}
\begin{exampleblock}{An example block}
  \begin{itemize} 
  \item Here in green, I'd like keep it in green. 
  \end{itemize}
\end{exampleblock}
\end{frame}
\end{document}

Minimum working example

If I look to beamercolorthemedefault.sty, I see that items are colored using the local structure color:

  • If I change the local structure to black, normal blocks become black;
  • If I change directly the item color to black, it is black in all blocks.

So what is the correct way to obtain the desired result?

Best Answer

I would set the colour of local structure to black for normal text, then change it to match the colour of structure again when you start a normal block. This can be done by adding the redefinition of the colour to the beamer templateblock begin:

\documentclass{beamer}

\setbeamercolor{local structure}{parent=normal text}
\addtobeamertemplate{block begin}{\setbeamercolor{local structure}{parent=structure}}{}

\begin{document}
\begin{frame}
\begin{itemize} 
\item Here in blue, I'd like it in black. 
\end{itemize}
\begin{block}{A block}
  \begin{itemize} 
  \item Here in blue, I'd like keep it in blue. 
  \end{itemize}
\end{block}
\begin{alertblock}{An alert block}
  \begin{itemize} 
  \item Here in red, I'd like keep it in red. 
  \end{itemize}
\end{alertblock}
\begin{exampleblock}{An example block}
  \begin{itemize} 
  \item Here in green, I'd like keep it in green. 
  \end{itemize}
\end{exampleblock}
\end{frame}
\end{document}

output of the example code with bullets coloured in black, blue, red and green