[Tex/LaTex] Custom itemize environment which takes color as argument

beamercoloritemizelists

Using beamer, I would like to change the color of the itemize bullet according to a passed argument, something like

 \begin{myitemize}
    \item[red] no
    \item[green] yes
 \end{myitemize}

Is there any way to achieve it? I have been googling but with no success…

Best Answer

that needs a redefinition of \makelabel

\documentclass{beamer}
\usetheme{Frankfurt}
\setbeamertemplate{itemize item}[triangle]
\newcommand\Item[1][blue]{%
  \gdef\makelabel##1{{%
    \hss\llap{{%
      \usebeamerfont*{itemize \beameritemnestingprefix item}%
      \color{#1}##1}}}}
    \item }
\begin{document}

\begin{frame}{foo}{bar}
 \begin{itemize}[<+->]
   \Item[red] red 
   \Item[blue] blue
 \end{itemize}
\end{frame}

\end{document}