[texhax] Makros in \color

Arno Trautmann Arno.Trautmann at gmx.de
Wed Jun 16 20:59:16 CEST 2010


Hi all,

I want to abuse the \color makro a bit in the following way:

\color[RGB]{0 0 \themycount}

So the color will change as the counters change. This works. Trying it
with 2 counters:

\color[RGB]{0 \themycount \themycount},

I get errors from the \color-parser, I think:

! Argument of \c at lor@@RGB has an extra }.
<inserted text>
                \par
l.45 \begin{document}

Using the beamer class, this is a minimal example (other classes give
different error messages, but I guess it’s the same problem):

\documentclass{beamer}

\usepackage{color}
\newcounter{mycount}
\setcounter{mycount}{100}
\begin{document}
\color[RGB]{100 \themycount \themycount} test

\end{document}

So my question is: How to define a makro that gives a color depending on
the value of two counters?

cheers
Arno

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://tug.org/pipermail/texhax/attachments/20100616/21e6500d/attachment.bin>


More information about the texhax mailing list