# [Tex/LaTex] Change aspect of headrule and footrule on chapter pages

I want to customize the aspect of headrule and footrule in my document, using report class and titlesec.
Unfortunatly, my redefinition of \makeheadrule and \makefootrule is not taken into account for chapter pages.
Please find below a basic example with code and picture, the rule lines should be blue on both pages.

  \documentclass{report}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[pagestyles]{titlesec}

\newpagestyle{normalStyle}
\setfoot{}{Footer}{}\footrule}
\pagestyle{normalStyle}

\newpagestyle{chapterStyle}
\setfoot{}{Footer}{}\footrule}
\pagestyle{chapterStyle}

\assignpagestyle{\chapter}{chapterStyle}

\renewcommand\makefootrule{\color{cyan}\rule[\baselineskip]{\linewidth}{0.4pt}}

\begin{document}

\chapter{Some Chapter Title}

\lipsum

\end{document}


The problem is that \headrule calls \setheadrule, which then redefines \makeheadrule. This is done when the page style is set by \pagestyle or \thispagestyle (used for chapter pages). The same applies to \footrule.

Moving the redefinitions of \makeheadrule and \makefootrule into the definitions for the page styles, after \headrule and \footrule, solves this problem.

\documentclass{report}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[pagestyles]{titlesec}

\newpagestyle{normalStyle}{%
\setfoot{}{Footer}{}\footrule
\renewcommand\makefootrule{\color{cyan}\rule[\baselineskip]{\linewidth}{0.4pt}}
}

\newpagestyle{chapterStyle}{%
\setfoot{}{Footer}{}\footrule
\renewcommand\makefootrule{\color{cyan}\rule[\baselineskip]{\linewidth}{0.4pt}}
}

\assignpagestyle{\chapter}{chapterStyle}

\pagestyle{normalStyle}

\begin{document}

\chapter{Some Chapter Title}

\lipsum

\end{document}