![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Mon, 18 Feb 2008, Jesse Alama wrote:
Hi Aditya,
Thanks for the help -- I think I now see why there is such trouble with colors in pgf and context. It looks like one can systematically transform LaTeX-like PGF examples of \color into ConTeXt examples.
The reason why this came up is that I'm trying to go through Till Tantau's "Example for Karl's Students" tutorial in the PGF/TikZ manual. Has anyone managed to ConTeXt-ify that example?
I did that some time back while testing tikz. I will send that file as a reply to this email, since I am not sure if it will go through the mailing list because of its size.
The example features some \definecolor's which I just did away with (sadly) by simply substituting their defining values for their occurences. (This is unfortunate, but perhaps necessary until some other mechanism is produced.) The problem is that the text box to the right of the picture is supposed to be colored, and with rounded corners. But the box is missing. Look at p. 20 of
The TikZ manual make a lot of uses of the xcolor syntax (e.g. \color{red!20}). There is no equivalent ConTeXt syntax. You need to define a color, say lightred, as follows \definecolor[lightred][r=0.2] For tikz key-value options, pgf works behind the scene to define appropriate colors, so xcolor syntax works for them. So \fill[fillcolor=red!20] will work as expected. However, when using \color inside any box, you need to follow ConTeXt syntax. So \color[red!20] will not work, you need to define a context color and then use that. Hope that this clarifies some things. Aditya