# Changing color and header of beamer with CambridgeUS

How to change the red color for - the titles - the topics

How to adjust the position of the header1 and 2?

\documentclass{beamer}

\usetheme{CambridgeUS}

% Set Color ==============================

% Custom colors
\usepackage{xcolor}

% http://www.computerhope.com/htmcolor.htm
\definecolor{gold}{HTML}{FDD017}
\definecolor{deep sky blue}{HTML}{3BB9FF}
\definecolor{light sky blue}{HTML}{82CAFA}

\makeatletter
\definecolor{mybackground}{HTML}{82CAFA}
\definecolor{myforeground}{HTML}{0000A0}

\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{example text}{fg=black}

\setbeamercolor{background canvas}{fg=myforeground, bg=white}
\setbeamercolor{background}{fg=myforeground, bg=mybackground}

\setbeamercolor{palette primary}{fg=black, bg=gray!30!white}
\setbeamercolor{palette secondary}{fg=black, bg=gray!20!white}
\setbeamercolor{palette tertiary}{fg=black, bg=gold}
\makeatother
% Set Color ==============================

\title{Title1}
\subtitle{Title2}
\author{Author}
\institute{Institute}
\date{Date}

\begin{document}

\frame{

}

\section[Outline]{}
\frame{\tableofcontents}

\frame{\frametitle{Topic1}
%
HTML color codes are the \textbf{hexadecimal triplets} representing the colors red, green, and blue.
\vspace{0.25cm}
%
These color codes can be used to change the color of the background, text, and tables on a web page.
}
%
%
\end{document}


Title1 and 2

Topic1 and Header1 & 2

Align text left or right, center

-
possible duplicate? tex.stackexchange.com/questions/53288/… –  Papiro May 12 '13 at 2:31
What do you mean by "adjusting the position"? Do you want to chenge which parameter(s) exactly? –  Gonzalo Medina May 12 '13 at 2:38
@Langevin I think I still don't understand. Do you want the entries in the table of contents to be, for example, centered? –  Gonzalo Medina May 12 '13 at 3:14
@Langevin A now I see what you mean. In some minutes I'll give an answer. –  Gonzalo Medina May 12 '13 at 3:25
I am sorry to bother you, but may I ask if there's any problem with the answer below? I ask because I noticed that you have asked several follow-up questions (which you have accepted), but since you haven't accepted the answer to this one I wonder if there's something wrong with it. –  Gonzalo Medina May 13 '13 at 17:53

To change the color for the frame title and for the title and subtitle, you need to redefine the beamer colors frametitle and title:

\setbeamercolor{frametitle}{<color>}
\setbeamercolor{title}{<color>}


to change the position of the headers, you need to redefine the headline template as defined in the outer theme infolines (internally used by CambridgeUS). Here's the original definition:

\defbeamertemplate*{headline}{infolines theme}
{
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}}%
\vskip0pt%
}


As you can see, the alignment for the first beamercolorbox is right, and the one for the second box is left: you can change these as you wish.

In the following example I used a shade of cyan for the titles (not the best choice) and I used center for both boxes in the headline:

\documentclass{beamer}

\usetheme{CambridgeUS}

% Set Color ==============================

% Custom colors
\usepackage{xcolor}

% http://www.computerhope.com/htmcolor.htm
\definecolor{gold}{HTML}{FDD017}
\definecolor{deep sky blue}{HTML}{3BB9FF}
\definecolor{light sky blue}{HTML}{82CAFA}

\definecolor{mybackground}{HTML}{82CAFA}
\definecolor{myforeground}{HTML}{0000A0}

\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{example text}{fg=black}

\setbeamercolor{background canvas}{fg=myforeground, bg=white}
\setbeamercolor{background}{fg=myforeground, bg=mybackground}

\setbeamercolor{palette primary}{fg=black, bg=gray!30!white}
\setbeamercolor{palette secondary}{fg=black, bg=gray!20!white}
\setbeamercolor{palette tertiary}{fg=black, bg=gold}

\setbeamercolor{frametitle}{fg=cyan!80!black}
\setbeamercolor{title}{fg=cyan!80!black}

{
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}}%
\vskip0pt%
}

% Set Color ==============================

\title{Title1}
\subtitle{Title2}
\author{Author}
\institute{Institute}
\date{Date}

\begin{document}

\frame{\maketitle}

\section[Outline]{}
\frame{\tableofcontents}


@user32950 use bg=<color> in the frametitle color specification, as in \setbeamercolor{frametitle}{fg=cyan!80!black,bg=red}. –  Gonzalo Medina Jun 28 '13 at 17:21