仅更改某些章节页面的页码颜色

仅更改某些章节页面的页码颜色

我正在尝试在文档中插入一些彩色页面,我想更改这些页面上的页码颜色。我正在使用 fancyhdr 尝试更改文本颜色,但它在章节页面上不起作用。有没有关于如何在不更改所有其他章节页面上的页码颜色的情况下做到这一点的建议?

\documentclass{report}
\usepackage{fancyhdr,afterpage,pagecolor,xcolor}

\fancypagestyle{style1}{
\fancyhf{}
\newpagecolor{gray}\afterpage{\restorepagecolor}
\fancyfoot[CE,CO]{\textcolor{red}{\thepage}}
}

\begin{document}
\chapter*{Here's a chapter}Here the page number should remain black.
\chapter*{\textcolor{red}{Here's another chapter}}\pagestyle{style1}
\textcolor{red}{Here I would like the page number to be red.}
\newpage\pagestyle{style1} \textcolor{red}{Here the page number is red (which it should be)!}
\end{document}

相关内容