# Optionally colored links in ConTeXt

This question is about having colored links on screen while printing them black. The solution is

\documentclass{article}
\begin{document}
\href{https://tex.stackexchange.com/}{TeX Stackexchange}
\end{document}


I would like to have the same functionality in ConTeXt. The only commands touching link colors that I know of are:

\setupcolors[state=start|stop]
\setupinteraction[state=start|stop,color=...]


/edit: The question ConTeXt: Replace PDF Content During Printing provides the building blocks for a solution. Now we only need to find the code that renders links and replace it with \viewerlayer[view]{\color[#gotocolor]{#text}}\llap{\viewerlayer[print]{#text}}

• There is no support for coloured links via OCG in ConTeXt. I guess this is due to the fact that OCG would break PDF/A compatibility. – Henri Menke Feb 20 '17 at 11:15
• @Aditya This is not a duplicate. See my edit to the question. – Henri Menke Feb 23 '17 at 9:43
• @HenriMenke Do you want to write up an answer? – TeXnician Aug 8 '18 at 17:31
• @TeXnician No, because my comment is not an answer. – Henri Menke Aug 8 '18 at 21:03
• There's a question here where the answers offer two ways to put coloured boxes around links. Not quite what you're asking for, but they're screen-only and don't appear in print. – user31316 Dec 20 '18 at 22:13