[Tex/LaTex] How to change background color of the section box in header

beamercolorheader-footer

I want to change the color of the box in header containing the sections from white to the color of the word "Outline", and to change the color of the name of the sections in this box from red to be the color of the background of the frametitle. This is my current output

enter image description here

My code

\documentclass{beamer}
\mode<presentation>
{
  \usetheme{Madrid}      % or try Darmstadt, Madrid, Warsaw, ...
  \usecolortheme{beaver} % or try albatross, beaver, crane, ...
  \usefonttheme{serif}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 

 \usepackage[english]{babel}
 \usepackage[utf8x]{inputenc}
 \usepackage{xcolor}
 \usepackage{listings}
 \lstset
 {
 language=[LaTeX]TeX,
 breaklines=true,
 basicstyle=\tt\scriptsize,
 %commentstyle=\color{green}
 keywordstyle=\color{blue},
 %stringstyle=\color{black}
 identifierstyle=\color{magenta},
}

\title[latex in collaboration]{latex in collaboration}
\author{Alexandre Bernardino}
\institute{ISR/IST}
\date{March 9, 2015}

\AtBeginSection[]
 {
 \begin{frame}<beamer>
 \frametitle{Outline}
 \tableofcontents[currentsection,currentsubsection]
 \end{frame}
 }
 \makeatother
 \setbeamertemplate{footline}{\hspace*{.2cm}\scriptsize{\insertshorttitle
 \hspace*{3.5cm} \insertframenumber / \inserttotalframenumber}
 \vspace{4pt}} 
 \makeatletter
 \setbeamertemplate{navigation symbols}{}
  \makeatletter
  \setbeamertemplate{headline}{%
 \leavevmode%
 \hbox{%
 \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette 
   quaternary}%               
  \insertsectionnavigationhorizontal{\paperwidth}{}{}
  \end{beamercolorbox}%
  }
  }

 \makeatother
 \begin{document}

  \begin{frame}
  \titlepage
   \end{frame}

   % Uncomment these lines for an automatically generated outline.
   \begin{frame}{Outline}
    \tableofcontents
    \end{frame}

    \section{Introduction}
    \section{Some History}
    \section{First Steps}
     \section{\LaTeX{} Basics}

     \end{document}

Thank you in advance.

Best Answer

You can control the colours of the navigation bar with

\setbeamercolor{section in head/foot}{bg=gray!10!white, fg=gray!10!white}
\setbeamercolor{palette quaternary}{bg=darkred}

The first command changes the colour of the current section and the other sections, the second one the background colour.

MWE:

\documentclass{beamer}

\usetheme{Madrid}      
\usecolortheme{beaver} 
\setbeamercolor{section in head/foot}{bg=gray!10!white, fg=gray!10!white}
\setbeamercolor{palette quaternary}{bg=darkred}

\title[latex in collaboration]{latex in collaboration}
\author{Alexandre Bernardino}
\institute{ISR/IST}
\date{March 9, 2015}

\setbeamertemplate{headline}{%
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette 
     quaternary}%               
            \insertsectionnavigationhorizontal{\paperwidth}{}{}
        \end{beamercolorbox}%
    }
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Introduction}
\begin{frame}
\frametitle{test}
content...
\end{frame}

\section{Some History}
\begin{frame}
content...
\end{frame}


\section{First Steps}
\begin{frame}
content...
\end{frame}

\section{\LaTeX{} Basics}

\begin{frame}
content...
\end{frame}

\end{document}

enter image description here

Related Question