# Changing the colour of the text with itemize

I'm creating my own beamer theme. I can change the colour of the bullets using \setbeamercolor{}. But how can I change the colour of the text after the bullets? I would like to use it in a .sty file.

\documentclass[10pt]{beamer}

\definecolor{INBObrown}{RGB}{118, 91, 52}
\definecolor{INBOreddishbrown}{RGB}{182, 101, 70}
\definecolor{INBOblue}{RGB}{86, 152, 200}
\setbeamercolor{item}{fg=INBObrown}
\setbeamercolor{subitem}{fg=INBOreddishbrown}
\setbeamercolor{subsubitem}{fg=INBOblue}

\begin{document}

\begin{frame}
\begin{itemize}
\item This text should be in colour INBObrown
\begin{itemize}
\item This text should be in colour INBOreddishbrown
\begin{itemize}
\item This text should be in colour INBOblue
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}

\end{document}

-

## migrated from stackoverflow.comNov 30 '12 at 12:08

This question came from our site for professional and enthusiast programmers.

The following works:

\documentclass[10pt]{beamer}% http://ctan.org/pkg/beamer

\definecolor{INBObrown}{RGB}{118, 91, 52}
\definecolor{INBOreddishbrown}{RGB}{182, 101, 70}
\definecolor{INBOblue}{RGB}{86, 152, 200}
\setbeamercolor{item}{fg=INBObrown}
\setbeamercolor{subitem}{fg=INBOreddishbrown}
\setbeamercolor{subsubitem}{fg=INBOblue}

\makeatletter
\def\beamer@origitem{%
\@inmatherr\item\@ifnextchar[\@item{\@noitemargtrue\@item[\@itemlabel]%
\csname beamer@thcfg@\beameritemnestingprefix item\endcsname% Insert colour in \beamer@thc@fg
\ifx\beamer@thc@fg\@empty\relax\else\color{\beamer@thc@fg}\fi% Execute colour
}}
\makeatother

\begin{document}

\begin{frame}
\begin{itemize}
\item This text should be in colour INBObrown
\begin{itemize}
\item This text should be in colour INBOreddishbrown
\begin{itemize}
\item This text should be in colour INBOblue
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}

\end{document}


The idea is to capture the current item (foreground) colour in a macro called \beamer@thc@fg by executing the associated key-value macro. Then, simply applying that colour after setting the item label.

-
Your solution works great if I put the \makeatletter stuff in the tex file itself. However, I would like to put that in a theme (.sty file). And then it does not work. –  Thierry Dec 4 '12 at 13:56