Changing color of cites with hypersetup not working

  • colorlinks cannot be enabled, after hyperref is loaded. Set the option as package option:

    \usepackage[colorlinks]{hyperref}
    
  • The color Violet is undefined, this can be fixed, for example, by setting option svgnames for package xcolor.

  • As Augustin has already analyzed in his answer, class elsarticle defines the colors of all link types to blue. This is done via \AtBeginDocument. A later \AtBeginDocument can again overwrite the color settings as shown in the following example.

Test file (unnecessary packages for MWE removed):

\documentclass[preprint,3p,twocolumn,authoryear]{elsarticle}

\usepackage[table,xcdraw,svgnames]{xcolor}
\usepackage{natbib}  
\usepackage[colorlinks]{hyperref}
\AtBeginDocument{%
  \hypersetup{
    citecolor=Violet,
    linkcolor=Red,   
    urlcolor=Magenta}}

\begin{document}

\begin{frontmatter}
\title{Article}
\end{frontmatter}

\section{Introduction}

I'm citing the cite \citep{Bishop}.                                

\section*{References}

\bibliography{biblio}
\bibliographystyle{elsarticle-harv}

\end{document}

Result

Remark:

If you want to submit the article and the publisher requires the use of class elsarticle, then the publisher might not want that the user changes the link colors and should be asked before submitting.


The problem is caused by the elsarticle class which defines the colour of the links and prevents you from redefining them. If you change the style to article everything will work.