ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* color expansion (not colo-new related)
@ 2007-08-30 17:30 Peter Rolf
  2007-08-30 18:47 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Rolf @ 2007-08-30 17:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Hi all,

I tried to seperate some style specific code to external variables. Most
things work so far, but the expansion of color causes me problems. I
must emphasize that this is no colo-new problem, as my code fails with
the old colo-ini too.

I have tried several things, but still no luck. What (expansion) magic
is missing in my code? Any help is welcome.

Peter

[-- Attachment #2: fgcolor.tex --]
[-- Type: text/plain, Size: 772 bytes --]

\setupcolors[state=start]

\newconditional\CondA
\newconditional\CondB
\newconditional\CondC

% state dependend color
\def\GetFGcolor#1#2#3#4#5{%
  \ifconditional\CondA
    \ifconditional\CondC#4
    \else#5\fi
  \else
    \ifconditional\CondB#1
    \else
      \ifconditional\CondC#2
      \else#3\fi
    \fi
  \fi}%


\starttext

%\settrue\CondA
%\settrue\CondB
\settrue\CondC

\setvariables[FOO][foregroundcolor=\GetFGcolor{red}{green}{blue}{lightgray}{darkgray}]

\color[red]{color} is working.

\edef\FGcolor{\getvariable{FOO}{foregroundcolor}}
%\edef\FGcolor{\GetFGcolor{red}{green}{blue}{lightgray}{darkgray}}
FGcolor=\FGcolor


foregroundcolor= \color[\FGcolor]{\getvariable{FOO}{foregroundcolor}}% no color here

\stoptext


[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2007-08-30 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-30 17:30 color expansion (not colo-new related) Peter Rolf
2007-08-30 18:47 ` Hans Hagen
2007-08-30 19:37   ` Peter Rolf

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