Unfortunaly there is no MWE in the question. So here is only a suggestion that works for a simple three part header using package fancyhdr.
\documentclass{book}
\usepackage{xcolor}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE]{%
\strut\rlap{\color{blue!20}\rule[-\dp\strutbox]{\headwidth}{\headheight}}%
Left part (even page)}
\fancyhead[LO]{%
\strut\rlap{\color{blue!20}\rule[-\dp\strutbox]{\headwidth}{\headheight}}%
Left part (odd page)}
\fancyhead[C]{Middle part}
\fancyhead[R]{Right part}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

\documentclass{book}
\usepackage{xcolor}
\usepackage[
headsepline,plainheadsepline
]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{Inner part}
\chead{Middle part}
\ohead{Outer part}
\setkomafont{pagehead}{\upshape}
\DeclareNewLayer[
background,
head,
contents={\color{blue!20}\rule[-\dp\strutbox]{\layerwidth}{\layerheight}}
]{head.bg}
\AddLayersAtBeginOfPageStyle{scrheadings}{head.bg}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}
Or starting with KOMA-Script version 3.19
\documentclass{book}
\usepackage{xcolor}
\usepackage[
headsepline,plainheadsepline
]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{Inner part}
\chead{Middle part}
\ohead{Outer part}
\setkomafont{pagehead}{\upshape}
\DeclareNewLayer[
background,
head,
mode=picture,
contents={\putLL{\color{blue!20}\rule{\layerwidth}{\layerheight}}}
]{head.bg}
\AddLayersAtBeginOfPageStyle{scrheadings}{head.bg}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}
With scrlayer-scrpage it is also easy to color the top margin including the header.
\documentclass{book}
\usepackage{xcolor}
\usepackage[
%headsepline,plainheadsepline
]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{Inner part}
\chead{Middle part}
\ohead{Outer part}
\setkomafont{pagehead}{\upshape}
\DeclareNewLayer[
background,
topmargin,
addheight=\headheight,
contents={\color{blue!20}\rule{\layerwidth}{\layerheight}}
]{head.bg}
\AddLayersAtBeginOfPageStyle{scrheadings}{head.bg}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

If you want to use fancyhdr instead you can draw the background image using TikZ with the remember picture,ovelay options. So you have to run the code twice to get the rectangle on the right position.
\documentclass{book}
\usepackage{tikz}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\headrulewidth{0pt}
\fancyhead[LE]{%
\tikz[remember picture,overlay,baseline]
\fill[blue!20](current page.north west|-0,-\dp\strutbox)
rectangle(current page.north east);%
Left part (even page)}
\fancyhead[LO]{%
\tikz[remember picture,overlay,baseline]
\fill[blue!20](current page.north west|-0,-\dp\strutbox)
rectangle(current page.north east);%
Left part (odd page)}
\fancyhead[C]{Middle part}
\fancyhead[R]{Right part}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}
scrlayer-scrpageversion works for me also through DVI with landscape mode ;-) I do not really understand the fix from your link but I think that the second argument of\pgfqpointhave to be enlarged. – esdd Oct 03 '15 at 13:37