[Tex/LaTex] How to create custom itemize-unfolding-animations in beamer

animatebeamer

I'm still a newbie in beamer so sorry if it's a simple question: I want to animate an "unfolding of itemize" in a custom way. So instead of the standard:

\begin{itemize} 
    \item<1-> item-1
    \item<2-> item-2
    \item<3-> item-3
\end{itemize}

I want the item-i that are not "in focus" to be grayed out. The following code does exactly what I want:

\def\colorize<#1>{%
 \temporal<#1>{\color{black!50}}{\color{black}}{\color{black!50}}}

\begin{itemize} 
    \colorize<1>\item item-1
    \colorize<2>\item item-2
    \colorize<3>\item item-3
\end{itemize}

However, it's a lot of code to write colorize<i> every time.

My question: is there a way to define a macro (lets call it grayoutunhighlighted) so that I could do something like: \begin{itemize}[<-+| grayoutunhighlighted@+>]?
Thanks!

Best Answer

Here a simple solution:

\documentclass{beamer}
\setbeamercovered{transparent}

\begin{document}
\begin{frame}
\begin{itemize}[<+-+>]
    \item item-1
    \item item-2
    \item item-3
\end{itemize}
\end{frame}

\end{document}

You can use the optional argument of the itemize environment which is defined by beamer itself.