1

I'm trying to do a local beamer style, which puts the logo in the bottom corner. The simple case is easy:

\newcommand{\wmflogo}{
  \begin{tikzpicture}[remember picture,overlay]
    \node [xshift=0.05\textwidth,yshift=0.05\textheight]
    at (current page.south west) {
      \includegraphics[width=0.05\textwidth]{logos/Wikimedia-logo_black.eps}};
  \end{tikzpicture}
}

\setbeamertemplate{footline}{
  \wmflogo
}

...but we also have a white logo, and what I want to do is have the white logo (logos/Wikimedia-logo_white.eps) used instead if the current foreground colour is white. Is it possible to do this? I can't find how to inspect the current foreground colour at all, never mind how to do any sort of comparison or ifthen with it...

1 Answer 1

2

Beamer stores the current foreground colour in \beamer@thc@fg:

\documentclass{beamer}

\setbeamercolor{background canvas}{bg=blue}

\makeatletter
\edef\whitestring{white}
\newcommand\ifbeamercolorwhite[2]{%
  \ifx\beamer@thc@fg\whitestring
    #1
  \else
    #2
  \fi
}
\makeatother

\begin{document}
    
\begin{frame}

\setbeamercolor{normal text}{fg=red}
\usebeamercolor[fg]{normal text}
    abc \ifbeamercolorwhite{yes}{no}
  
\setbeamercolor{normal text}{fg=white}
\usebeamercolor[fg]{normal text}
    abc \ifbeamercolorwhite{yes}{no}  
\end{frame} 
    
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .