Change URL color to match layer
![](https://secure.gravatar.com/avatar/183212d7a811ebcd19b6d035af7fc813.jpg?s=120&d=mm&r=g)
I would like to change the color of URL's in parts of a document. In particular I am using the letter module and would like to have the color of URL's match the color of text in the letterhead and then change to match the color in the main body of the letter. I can set the URL color once with \setupinteraction but I do not see how to change it thereafter. Thank you very much for your guidance. Best, Michael \usemodule[letter] \setupinteraction[state=start,color=black] %% \setupinteraction[state=start,color=red] %% Would like this URL to match the color of the return address ("location") \useURL[author-email][mailto:mash@econs.umass.edu][][mash@econs.umass.edu] %% Would like this URL to match the color of the recipient's address ("address") \useURL[recipient-email][mailto:addressee@gmail.com][][addressee@gmail.com] %% Would like this URL to match the color of the main body \useURL[knuthbio][ http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth ] \setupletter[ name={Michael Ash}, email={\from[author-email]} ] \setupletter[signature={Michael Ash}] \defineletterelement[layer][location][example]{\correspondenceparameter{name} \correspondenceparameter{email}\par} \setupletterlayer[location][alternative=example,color=red] \defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par} \setupletterlayer[address][alternative=example,color=blue] \starttext \startletter[ toname={The Addressee\\\from[recipient-email]}, opening={Dear Addressee:}, closing={Best regards,}] Enjoy \from[knuthbio] \stopletter \stoptext
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 30.07.2013 um 23:57 schrieb Michael Ash
I would like to change the color of URL's in parts of a document.
In particular I am using the letter module and would like to have the color of URL's match the color of text in the letterhead and then change to match the color in the main body of the letter.
I can set the URL color once with \setupinteraction but I do not see how to change it thereafter.
You can disable the default style and color with \setupinteraction[color=,style=], the links will now use the attributes of the surrounding text. Wolfgang
![](https://secure.gravatar.com/avatar/183212d7a811ebcd19b6d035af7fc813.jpg?s=120&d=mm&r=g)
I think that I have found an answer: in the \setupinteraction command that
manages URL's, hyperlinks, PDF properties, etc. include
color=,contrastcolor=,
\usemodule[letter]
%% Would like this URL to match the color of the return address ("location")
\useURL[author-email][mailto:author@myhome.com][][author@myhome.com]
%% Would like this URL to match the color of the recipient's address
("address")
\useURL[recipient-email][mailto:addressee@gmail.com][][addressee@gmail.com]
%% Would like this URL to match the color of the main body
\useURL[knuthbio][
http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
]
\setupinteraction[state=start,color=,contrastcolor=,style=normal]
\setupletter[
name={Michael Ash},
email={\from[author-email]}
]
\setupletter[signature={Michael Ash}]
\defineletterelement[layer][location][example]{\correspondenceparameter{name}
\correspondenceparameter{email}\par}
\setupletterlayer[location][alternative=example,color=red]
\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
\setupletterlayer[address][alternative=example,color=blue]
\starttext
\startletter[
toname={The Addressee\\\from[recipient-email]},
opening={Dear Addressee:},
closing={Best regards,}]
Enjoy \from[knuthbio]
\stopletter
\stoptext
On Tue, Jul 30, 2013 at 5:57 PM, Michael Ash
I would like to change the color of URL's in parts of a document.
In particular I am using the letter module and would like to have the color of URL's match the color of text in the letterhead and then change to match the color in the main body of the letter.
I can set the URL color once with \setupinteraction but I do not see how to change it thereafter.
Thank you very much for your guidance.
Best, Michael
\usemodule[letter]
\setupinteraction[state=start,color=black] %% \setupinteraction[state=start,color=red]
%% Would like this URL to match the color of the return address ("location") \useURL[author-email][mailto:mash@econs.umass.edu][][mash@econs.umass.edu] %% Would like this URL to match the color of the recipient's address ("address") \useURL[recipient-email][mailto:addressee@gmail.com][][addressee@gmail.com ] %% Would like this URL to match the color of the main body \useURL[knuthbio][ http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth ]
\setupletter[ name={Michael Ash}, email={\from[author-email]} ]
\setupletter[signature={Michael Ash}]
\defineletterelement[layer][location][example]{\correspondenceparameter{name} \correspondenceparameter{email}\par} \setupletterlayer[location][alternative=example,color=red]
\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par} \setupletterlayer[address][alternative=example,color=blue]
\starttext \startletter[ toname={The Addressee\\\from[recipient-email]}, opening={Dear Addressee:}, closing={Best regards,}]
Enjoy \from[knuthbio]
\stopletter \stoptext
-- Michael Ash, Chair, Department of Economics Professor of Economics and Public Policy University of Massachusetts Amherst Amherst, MA 01003 Email mash@econs.umass.edu Tel +1-413-545-2590 Twitter https://twitter.com/michaelaoash
participants (2)
-
Michael Ash
-
Wolfgang Schuster