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?
1 Answers
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=<2>{highlight=red},onslide=<3->{highlight2=red},right=of fe.center] (he) {\textcolor<2->{red}{Feature Extraction}};
\end{tikzpicture}
% \end{centering}
\end{figure}
\end{frame}
\end{document}
- 158,329
-
In original question, the boxes can get three colors i-e red,green,blue. So when a particular box gets green, I want to fill it will lighter shade of green. When it gets red, fill also changes to red. and so on – NAASI Jun 29 '16 at 21:12
-
@NAASI See the edit – samcarter_is_at_topanswers.xyz Jun 29 '16 at 22:02
