As the title reads, I'd like to color my ToC in let's say red and the references in my document with another color let's say blue.
here's a MWE of my document :
\documentclass{report}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{lipsum}
\title{test colors}
\author{Oddant}
\hypersetup{
colorlinks=true,
linktoc=all,
linkcolor=blue
}
\begin{document}
\tableofcontents
\chapter{foo}
\section{bar}
go to \ref{lipsum}
\chapter{oof}
\section{rab}
\label{lipsum}
\lipsum
\end{document}
If you compile the code above you would notice that the ToC is in the same color than the reference in the bar section.
How can I color my ToC in black for instance without installing any extra packages like tocloft ?
Is there any parameters to place in hypersetup to get what I want, i peeked into the documentation of hyperref but I come here with any clue.
\begingroup \hypersetup{linkcolor=red} \tableofcontents \endgroup