答案1
我想最简单的方法是将彩色方块添加到\makeoddhead
\documentclass{memoir}
\makepagestyle{standard} % Make standard pagestyle
\setlength{\headheight}{13.60005pt}
\makeatletter % Define standard pagestyle
\makeevenfoot{standard}{}{}{} %
\makeoddfoot{standard}{}{}{} %
\makeevenhead{standard}{\bfseries\thepage\normalfont\qquad\small\leftmark}{}{}
\makeoddhead{standard}{}{}{%
{\color{yellow}\rule{1em}{1em}}%
{\color{orange}\rule{1em}{1em}}%
{\color{red}\rule{1em}{1em}}%
{\color{purple}\rule{1em}{1em}}%
{\color{blue}\rule{1em}{1em}}%
{\color{cyan}\rule{1em}{1em}}%
{\color{green}\rule{1em}{1em}}%
\hfill\small\rightmark\qquad\bfseries\thepage}
\makeheadrule{standard}{\textwidth}{\normalrulethickness}
\makeatother %
\makeatletter
\makepsmarks{standard}{
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{ \quad }
\createmark{section}{right}{shownumber}{}{ \quad }
}
\makeatother %
\nouppercaseheads
\pagestyle{standard}
\usepackage{xcolor}
\usepackage{lipsum} % Just to put in some text
\begin{document}
\frontmatter
\chapter{Introduction}
\lipsum[1-12]
\end{document}