# Changing the colour of a smartdiagram in beamer

I have built a beamer presentation utilising the smartdiagram package.

The diagram appears animated but then I want to highlight two of the steps on the smart diagram. I have done this with the following code but is there a way to do it within a single frame? I have looked at using the \againframe command but had no success. The code below generates the desired effect but on 3 frames rather than 1.

\documentclass{beamer}

\mode<presentation>
{
\usecolortheme{seahorse}
\setbeamercovered{transparent}
}

\usepackage{smartdiagram}

\begin{document}

\begin{frame}{Slide Title}
\centering
\scalebox{0.6}{
\smartdiagramset{sequence item height=2.5cm,
uniform color list=gray!60 for 5 items,
}
\smartdiagramanimated[sequence diagram]{Step 1, Step 2, Step 3, Step 4, Step 5
}
}
\end{frame}

\begin{frame}{Slide Title} % Highlight the 1st item red
\centering
\scalebox{0.6}{
\smartdiagramset{sequence item height=2.5cm, set color list={red!60,gray!60,gray!60,gray!60,gray!60}
}
\smartdiagram[sequence diagram]{Step 1, Step 2, Step 3, Step 4, Step 5
}
}
\end{frame}

\begin{frame}{Slide Title} % highglight the 1st and 4th item red
\centering
\scalebox{0.6}{
\smartdiagramset{sequence item height=2.5cm,
set color list={red!60,gray!60,gray!60,red!60,gray!60}
}
\smartdiagram[sequence diagram]{Step 1, Step 2, Step 3, Step 4, Step 5
}
}
\end{frame}


Yes. All you need is to add the custom color list from slides 6 onwards, which can be achieved with

\only<6>{\smartdiagramset{set color
list={red!60,gray!60,gray!60,gray!60,gray!60}}}


and so on. Complete MWE:

\documentclass{beamer}

\mode<presentation>
{
\usecolortheme{seahorse}
\setbeamercovered{transparent}
}

\usepackage{smartdiagram}
%\usetikzlibrary{overlay-beamer-styles}
\begin{document}

\begin{frame}{Slide Title}
\centering
\scalebox{0.6}{
\smartdiagramset{sequence item height=2.5cm,
uniform color list=gray!60 for 5 items}
\only<6>{\smartdiagramset{set color
list={red!60,gray!60,gray!60,gray!60,gray!60}}}
\only<7>{\smartdiagramset{set color
list={red!60,gray!60,gray!60,red!60,gray!60}}}
\smartdiagramanimated[sequence diagram]{Step 1, Step 2, Step 3, Step 4, Step 5
}
}
\end{frame}
\end{document}


• Perfect, thank you very much! I also used the '\againframe<6>' command to call the highlighted image at a later point – Philip Aldhous Apr 29 '19 at 15:32
• @PhilipAldhous Yes, \againframe is certainly useful. You may also want to have a look at the TikZ library overlay-beamer-styles, which is by the same author as smartdiagram and another tool that can be used to avoid repetition, see e.g. tex.stackexchange.com/a/488106/121799. – user121799 Apr 29 '19 at 15:35