[Tex/LaTex] How to make sure that \pageref{LastPage} doesn’t get colored like the other links identified by hyperref

colorhyperreflastpage

I am using hyperref together with lastpage. My problem is that \pageref{LastPage} gets the same color as the links identified with hyperref. I want it to be just the ordinary color (e.g. black)

Allow me to adapt the chosen answer to my previous question about lastpage:

\documentclass{scrartcl}

\usepackage{hyperref}
\hypersetup{colorlinks,breaklinks,
            urlcolor=Maroon,
            linkcolor=Maroon}

\usepackage{lastpage}
\usepackage{scrpage2}

\cfoot{\thepage\ of \pageref{LastPage}}

\pagestyle{scrheadings}

\begin{document}

\href{mailto:my_email@email.com}{my_email@email.com}

\newpage
text
\newpage
text
\end{document}

I tried \usepackage{color} and then modifying the \cfoot... line to \cfoot{\thepage\ of \color{black}\pageref{LastPage}}, but to no avail.

Best Answer

Use \pageref* as described in the hyperref manual.