This is a quick 'n' dirty example based on fancyhead gradient doesn't match bg colour. To be honest, I do not fully understand the code.
0.01 is the thickness (in cm) on the headrule and
14.98 is the length (in cm).
The important part is that you can re-define
command with some
At least, you can use the code as a basis for your own experiments and as a basis for a potential follow-up question (see here).
\shade[left color=white, right color=blue, dashed] (0,0) rectangle (14.98,0.01);