4

I want to set all links within my document to some customcolor (different from those available by default: white, black, red, green, blue, cyan, magenta, yellow). Is there a way to achieve that?

\documentclass{article}
\usepackage[colorlinks=true,allcolors=%customcolor
]{hyperref}
\begin{document}
\end{document}
6

To use custom defined colors you have to load the xcolor package in the preamble, as it gives you a couple of predefined conversion tables, such as RGB, CYMK, etc.

Then invoke the following command like described:

\definecolor{<custom name for color>}{<color model>}{<color values>}

The values depend on the color model, e.g. for the HTML color model you need to express the color in HEX values (see example).

Example:

\documentclass{standalone}

\usepackage{xcolor}

\definecolor{freakishgreen}{HTML}{0A982B}

\usepackage[colorlinks=true,allcolors=freakishgreen]{hyperref}

\begin{document}

colored links appear \href{here}{www.google.com}...

\end{document}

Edit: As an alternative to xcolor there is the color package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.