ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* color in before=
@ 2006-01-25 19:38 Hans van der Meer
  2006-01-25 19:55 ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Hans van der Meer @ 2006-01-25 19:38 UTC (permalink / raw)


I want to put a color command in a "before" command, that command  
being inserted in a macro.
Something like \setupxyz[before=\color[green]{whatever}]

The problem is that the argument parser gets confused when []- 
expressions are found within the setup.
It is not an option to reprogram everything with {}'s instead of  
[]'s, because then I lose to much of ConTeXt's abilities (apart from  
the nuisance of having to reprogram something that has already been  
done).

I suspect there is no way of sneaking in these []'s inside the  
command? That is the general solution.

My eyes spotted something like \dowithcolor#1#2, but there TeX  
complains about not knowing \od.

Is there a solution to this problem?

yours sincerely,
dr. H. van der Meer

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

* Re: color in before=
  2006-01-25 19:38 color in before= Hans van der Meer
@ 2006-01-25 19:55 ` Taco Hoekwater
  2006-01-25 21:13   ` Hans van der Meer
  0 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 2006-01-25 19:55 UTC (permalink / raw)


Hans van der Meer wrote:
> I suspect there is no way of sneaking in these []'s inside the  
> command? That is the general solution.

\setupxyz[before={\color[green]{whatever}}]

Cheers, Taco

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

* Re: color in before=
  2006-01-25 19:55 ` Taco Hoekwater
@ 2006-01-25 21:13   ` Hans van der Meer
  2006-01-26  9:01     ` Taco Hoekwater
  2006-01-26  9:28     ` Hans van der Meer
  0 siblings, 2 replies; 5+ messages in thread
From: Hans van der Meer @ 2006-01-25 21:13 UTC (permalink / raw)


Thanks, that worked. But it leads to my next question, I am afraid.

When I define:
	\definecolor [brightred][r=0.7, g=.1, b=.1]
then I can use this in \startcolor[brightred]...\stopcolor
according to \meaning brightred being \protected macro \switchtocolor  
[brightred]

Now I am fond of symbolic names and therefore also defined:
		\definecolor [FrameColor][brightred]
Thus being able to use FrameColor as \MPcolor{FrameColor} in MetaFun.
(\meaning says \MPcolor{FrameColor} is \scaledMPcolor 1Framecolor,  
\FrameColor being undefined)

I thought to use \MPcolor{FrameColor} also in
	\startcolor[\MPcolor{FrameColor}]...\stopcolor
or	\startcolor[FrameColor]...\stopcolor
but neither of these worked, nor did
{\switchtocolor[FrameColor]...}\crlf
{\switchtocolor[\MPcolor{FrameColor}]...}\crlf

How can I use FrameColor here to? Without defining extra macros  
around FrameColor, I hope.

On Jan 25, 2006, at 20:55, Taco Hoekwater wrote:

> Hans van der Meer wrote:
>> I suspect there is no way of sneaking in these []'s inside the
>> command? That is the general solution.
>
> \setupxyz[before={\color[green]{whatever}}]
>
> Cheers, Taco
> ______________________________________________


yours sincerely,
dr. H. van der Meer

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

* Re: color in before=
  2006-01-25 21:13   ` Hans van der Meer
@ 2006-01-26  9:01     ` Taco Hoekwater
  2006-01-26  9:28     ` Hans van der Meer
  1 sibling, 0 replies; 5+ messages in thread
From: Taco Hoekwater @ 2006-01-26  9:01 UTC (permalink / raw)




Hans van der Meer wrote:
> Thanks, that worked. But it leads to my next question, I am afraid.

This really should have worked:

   \definecolor [brightred][r=0.7, g=.1, b=.1]
   \definecolor [FrameColor][brightred]
   \setupcolors[state=start]
   \starttext
   \startcolor[FrameColor]Bright Red\stopcolor
   \stoptext


Cheers, taco

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

* Re: color in before=
  2006-01-25 21:13   ` Hans van der Meer
  2006-01-26  9:01     ` Taco Hoekwater
@ 2006-01-26  9:28     ` Hans van der Meer
  1 sibling, 0 replies; 5+ messages in thread
From: Hans van der Meer @ 2006-01-26  9:28 UTC (permalink / raw)


Please forget about the posting below.
I messed up something else (having to do with not enabling the  
appropriate mode selections in other files).
Sorry.

yours sincerely,
dr. H. van der Meer



On Jan 25, 2006, at 22:13, Hans van der Meer wrote:

>
> I thought to use \MPcolor{FrameColor} also in
> 	\startcolor[\MPcolor{FrameColor}]...\stopcolor
> or	\startcolor[FrameColor]...\stopcolor
> but neither of these worked, nor did
> {\switchtocolor[FrameColor]...}\crlf
> {\switchtocolor[\MPcolor{FrameColor}]...}\crlf
>
> How can I use FrameColor here to? Without defining extra macros
> around FrameColor, I hope.
>
>
> yours sincerely,
> dr. H. van der Meer
>

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

end of thread, other threads:[~2006-01-26  9:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-25 19:38 color in before= Hans van der Meer
2006-01-25 19:55 ` Taco Hoekwater
2006-01-25 21:13   ` Hans van der Meer
2006-01-26  9:01     ` Taco Hoekwater
2006-01-26  9:28     ` Hans van der Meer

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).