I have some text that I want to change colour depending on the current state of a counter. But I can't get this file to compile. (This is obviously simplified, since the texcolour command is actually part of a command defined in the preamble...)
\documentclass{article}
\usepackage{xcolor}
\newcounter{foo}
\setcounter{foo}{30}
\begin{document}
\textcolor[RGB]{0,\value{foo},0}{Text in FOO colour}
\end{document}
I get the following error repeated:
! Missing number, treated as zero.
<to be read again>
\
l.8 ...r[RGB]{0,\value{foo},0}{Text in FOO colour}
! Illegal unit of measure (pt inserted).
<to be read again>
\
l.8 ...r[RGB]{0,\value{foo},0}{Text in FOO colour}
I'm sure there's some subtlety I've not grasped yet... But \vskip \value{foo} pt compiles fine and gives me space depending on the value of the counter, so I can't be far off...
rbgmodel requires numbers between 0 and 1. The RGB model requires integers between 0 and\rangeRGB, which defaults to 255. – Jan Hlavacek Dec 15 '10 at 19:09red!\value{foo}!blue. But as @Jan says, RGB uses numbers up to 255 – Seamus Dec 15 '10 at 22:30