[Tex/LaTex] How to change text color in footline

beamercolorheader-footer

I hope this is not a duplicate question, but I did not find my answer. I have seen how to change the background color of footline, but not how to change text color.

I have this code for my footline:

\makeatletter
\newdimen\mywidth%
\setlength{\mywidth}{\paperwidth}%
\addtolength{\mywidth}{-\beamer@sidebarwidth}%
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=\beamer@sidebarwidth,ht=2.25ex,dp=1ex,right]{sidebar}%
  \end{beamercolorbox}
  \begin{beamercolorbox}[wd=\mywidth,ht=2.25ex,dp=1ex,right]{normal text}%
    \usebeamerfont{date in head/foot}\hfill\insertshortauthor{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother

This code produces just what I want: Author and frame number in footline, but I want it to show the text in a specific color I have defined before:

\definecolor{beamer@ColorIPN}{RGB}{140,17,17}

My question is, how do I change text color in foot line from black to IPN color?

Best Answer

If you look about beamercolorbox in beameruserguide will see that its parameter is a beamercolor. Therefore, your footline uses normal text color to write text in it. As I image you don't want to change normal text definition, I'll explain how to change it for your footline text.

Once you have defined the color you want with

\definecolor{beamer@ColorIPN}{RGB}{140,17,17}

you need to use it in any beamercolor, let's say,

\setbeamercolor{myfootlinetext}{fg=beamer@ColorIPN}

With this command a new beamercolor called myfootlinetext is defined and it foreground component is fixed. Its background component is not defined.

Now you can use where you need it. In this case, replace normal text with myfootlinetext in the second beamercolorbox. That's all.

enter image description here

Following code uses Berkeley theme because your footline failed with default theme.

\documentclass{beamer}

\usetheme{Berkeley}

\makeatletter

\definecolor{beamer@ColorIPN}{RGB}{140,17,17}
\setbeamercolor{myfootlinetext}{fg=beamer@ColorIPN}

\newdimen\mywidth%
\setlength{\mywidth}{\paperwidth}%
\addtolength{\mywidth}{-\beamer@sidebarwidth}%
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=\beamer@sidebarwidth,ht=2.25ex,dp=1ex,right]{sidebar}%
  \end{beamercolorbox}
  \begin{beamercolorbox}[wd=\mywidth,ht=2.25ex,dp=1ex,right]{myfootlinetext}%
    \usebeamerfont{date in head/foot}\hfill\insertshortauthor{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother

\author{I'm the author}
\title{}

\begin{document}
\section{First Section}
\begin{frame}{First frame}

\end{frame}
\end{document}