# [Tex/LaTex] Change the color of a single itemize item — command to do that

beamercoloritemize

My question concerns itemize items in Beamer slides. I want to obtain the following slide:

This has been produced by the code:

\documentclass{beamer}
\begin{document}
\begin{frame}{Title}
\begin{itemize}
\setbeamercolor{local structure}{fg=red}
\item \textcolor{red}{Red}, other text
\setbeamercolor{local structure}{fg=green}
\item \textcolor{green}{Green}, other text
\setbeamercolor{local structure}{fg=blue}
\item \textcolor{blue}{Blue}, other text
\end{itemize}
\end{frame}
\end{document}


Question. Is there a way to define a command \coloreditem{<color>} so that the above slide can be defined by the simplified code that follows?

\begin{frame}{Title}
\begin{itemize}
\coloreditem{red} \textcolor{red}{Red}, other text
\coloreditem{green} \textcolor{green}{Green}, other text
\item \textcolor{blue}{Blue}, other text
\end{itemize}
\end{frame}


My first guess was to define

\newcommand\coloreditem[1]{\setbeamercolor{local structure}{fg=#1}\item}


but of course the local structure get changed for too long. And adding a new pair of {} does not work.

You could do it like this:

\documentclass{beamer}
\newcommand\coloreditem[1]{\item[\textcolor{#1}{\usebeamertemplate{itemize \beameritemnestingprefix item}}]}
\begin{document}
\begin{frame}{Title}
\begin{itemize}
\coloreditem{red} blabl \textcolor{red}{Red}, other text
\coloreditem{green} blalba \textcolor{green}{Green}, other text
\item bnlabla
\end{itemize}
\end{frame}
\end{document}