I'm trying to create a horizontal headline box consisting of two different colors. This is what I have right now:
\documentclass{beamer}
\usepackage{lmodern}
\definecolor{accent1}{RGB}{0, 110, 220} %blue
\definecolor{accent2}{RGB}{255, 248, 220} %cornsilk
\setbeamercolor{accent12}{fg=accent1,bg=accent2}
\setbeamercolor{accent21}{fg=accent2,bg=accent1}
\setbeamerfont{section in head/foot}{family=\rm}
\makeatletter
\setbeamertemplate{headline}
{
\leavevmode
\hbox
{
\begin{beamercolorbox}[wd=0.5\paperwidth,ht=3ex,dp=1.5ex,right]{accent12}
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.5\paperwidth,ht=3ex,dp=1.5ex,left]{accent21}
\usebeamerfont{section in head/foot}\hspace*{2ex}\insertsectionhead
\end{beamercolorbox}
}
\vskip0pt%
}
\makeatother
\beamertemplatenavigationsymbolsempty %remove navigation panel
\begin{document}
\section{Introduction}
\begin{frame}
hello
\end{frame}
\end{document}
there are a few problems with this code.
As you can see in the output there is a small space between the two color boxes, but why? Both boxes are set to a width of
0.5\paperwidth?There are overfull hbox warnings, why and how to get rid of them?

%from my answer, that's what causes the small space. And the overfull hbox is logical for a line that's longer than 20.5\paperwidth. – TeXnician May 28 '17 at 10:56%, which specific%are needed to get rid of the error? (Also, I never thought removing comment marks could make a code go from working to not working as intended...) – LinG May 28 '17 at 11:06\makeatletterand\makeatother) are needed. What those do is essentially preventing TeX from inserting a space (at least that's the effect). – TeXnician May 28 '17 at 11:08\leavevmodeand\hbox) or are there other things I should watch out for? – LinG May 28 '17 at 11:15