2

I have a question related to How to make beamer overlays with Tikz node. What Do I need to do so that the rectangles get filled with a color when they get highlighted. I am looking for a piece of code that will make the rectangles get a lighter shade of the current color but a general answer that would allow to assign any fill color will be appreciated. Also present solution assigns same color to text inside the highlighted blocks. How can I make text color different?

NAASI
  • 2,809

1 Answers1

5

The basic idea is to define different style and assign them for different overlay specification.

For changing text colours, simply sue \textcolor<2->{red}{Feature Extraction}

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning}

\tikzset{onslide/.code args={<#1>#2}{% \only<#1>{\pgfkeysalso{#2}} % \pgfkeysalso doesn't change the path }} \tikzset{temporal/.code args={<#1>#2#3#4}{% \temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}} % \pgfkeysalso doesn't change the path }}

\tikzset{highlight/.style={fill=#1!30!white}} \tikzset{highlight2/.style={fill=#1!60!white}}

\begin{document} \begin{frame} \begin{figure}%[h] % \begin{centering} \begin{tikzpicture}[ system/.style={draw,rectangle,rounded corners=3,minimum width=2cm,text width=1.8cm,text centered}, node distance=2cm ] \node [system,onslide=<1>{highlight=blue},onslide=<2->{highlight2=blue},anchor=center] (fe) {Feature Extraction};

\node [system,onslide=&lt;2&gt;{highlight=red},onslide=&lt;3-&gt;{highlight2=red},right=of fe.center] (he) {\textcolor&lt;2-&gt;{red}{Feature Extraction}};

\end{tikzpicture} % \end{centering} \end{figure} \end{frame} \end{document}

enter image description here