[Tex/LaTex] Get unicolor background navigation bar in Beamer’s singapore theme

beamercolorformatting

I would like to get the background color of the navigation bar in a single color rather than the default color gradient. Is there any way to do this?

This shows the color gradient in the navigation bar on top of the frame

Best Answer

Singapore uses a vertical shading defined as

\pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
  {%
    color(0cm)=(bg);
    color(1.25cm)=(section in head/foot.bg)%
  }

To get a solid color, you can redefine the shading to use only one color, as the following example demonstrates (of course, instead of structure.fg!25!bg you can use whatever color you wish):

\documentclass{beamer}
\usetheme{Singapore}

\makeatletter
\AtBeginDocument{%
  {
    \usebeamercolor{section in head/foot}
  }
  \pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
  {%
    color(0cm)=(structure.fg!25!bg);
    color(1.25cm)=(structure.fg!25!bg)%
  }
  \setbeamercolor{section in head/foot}{bg=}
}
\addtoheadtemplate{\pgfuseshading{beamer@headfade}\vskip-1.25cm}{}
\makeatother


\begin{document}

\begin{frame}
\tableofcontents
\end{frame}

\section{Test section one}
\begin{frame}test\end{frame}

\section{Test section two}
\begin{frame}test\end{frame}

\section{Test section three}
\begin{frame}test\end{frame}

\end{document}

The result:

enter image description here