SBML2TikZ

Home
Download
About Us
Contact Us
Site Map
Introduction to Modifying Colors
It makes intuitive sense that colors should be defined separately from the shapes that they outline or fill. Shapes in PGF/TikZ are drawn by specifying their color or colors, followed by information on the coordinates of the edges of the shape. For instance,
 
\draw[color = red, fill = blue] ... ...
 
tells PGF/TikZ that the next shape it draws (specified where "... ..." are above) has a red outline and a solid blue fill color. If we replace "... ..." above with coordinate information for a rectangle, we get:

Figure 1: a jarringly unattractive but simple rectangle

 
PGF/TikZ allows users to input coloring information either by the name of a common color (red, green, blue, etc) or by the color's ARGB value. SBML2TikZ writes coloring commands according to the information in the SBML file, but sometimes users may wish to use different colors instead. When this is the case, the user simply needs to find the block of commands drawing and coloring a certain shape, and change the color arguments in the commands.
 
Sounds complicated? It's actually not too difficult, since commands in the TeX written by SBML2TikZ are prefaced with comments describing what part of the graph they draw. For instance, in the Yeast Glycolysis example we can find the drawing of the following image Figure 2,

Figure 2: a rectanglular ATP glyph

 

by using whatever Find utility avalable in the TeX editor to look for the string "Rectangle for ATP." This immediately takes us to the following code block:

 

% Rectangle for ATP

\pgftransformshift{\pgfpoint{ 489pt }{ 259pt } }

\def \wholeShape {(0pt,0pt) rectangle(34pt,24pt)}

\fill[rounded corners = 5pt, shading = LinearGradient_1, shading angle = -90 ] \wholeShape;

\draw[line width = 1pt, color = Color_0!100, rounded corners = 5pt ] \wholeShape;

 

Here, the filling information for the light blue to white shading is stored in the "\fill" command's arguments, and the outline information for the grey outline color is stored in "\draw." The question is, how does PGF/TikZ interpret the strings:

 

shading = Linear_Gradient_1

color = Color_0!100

 

which obviously encode the color information in "\fill" and "\draw?" A more generalized answer can be found in the PGF/TikZ manual, but in the following section we go over some nicely contextualized examples.