ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* color as module parameter (mkiv)
@ 2012-05-14 15:53 Peter Schorsch
  2012-05-14 16:22 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Schorsch @ 2012-05-14 15:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I am trying to pass a tex color as a paramter to a module. I used the
example from the wiki as a base. But as soon I hand over a color
directly it does not work.

Any help is welcome as I am looking forward to hand
in my first module. Are there any rules how and where to hand in a
module for context?

Thanks
P.

--8<---Modul: bgcolor.tex---------------

\startmodule[bgcolor]
\unprotect
\definecolor[grau][s=.35]
\setupmodule[color=grau]
\setupbackgrounds[page][background=color,backgroundcolor=\currentmoduleparameter{color}]
\protect
\stopmodule
\endinput

--8<--tex file itself---------
\setupcolors[state=start]
\definecolor[bordeaux][r=.66]
\usemodule[bgcolor][color=bordeaux]
\starttext
Hello world!
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: color as module parameter (mkiv)
  2012-05-14 15:53 color as module parameter (mkiv) Peter Schorsch
@ 2012-05-14 16:22 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2012-05-14 16:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.05.2012 um 17:53 schrieb Peter Schorsch:

> Hi,
> 
> I am trying to pass a tex color as a paramter to a module. I used the
> example from the wiki as a base. But as soon I hand over a color
> directly it does not work.

You can expand the value

  \normalexpanded{\setupbackgrounds[…][…,backgroundcolor=\currentmoduleparameter{color}]}

or you can use \moduleparameter

  \setupbackgrounds[…][…,backgroundcolor=\moduleparameter{bgcolor}{color}]

> Any help is welcome as I am looking forward to hand
> in my first module. Are there any rules how and where to hand in a
> module for context?

1. You have to place the module in the correct sub folder.

2. Add your module on the modules page on the wiki.

3. Ask Mojca to add it to the context suite.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-14 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14 15:53 color as module parameter (mkiv) Peter Schorsch
2012-05-14 16:22 ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).