\section{Colors in DsTool}\label{colors}
 
\subsection{Color Modes and Viewing}
 
DsTool has two color modes: alternating color\index{color, alternating} and picked 
color\index{color, pick}.
The alternating color cycles through a list of entries in a colormap.
For example, different colors are used to distinguish flows.
The pick color can be selected by the user and is used to color
code points according to the type of phenomena they represent.  
 
Suppose the colormap\index{colormap, size} has $N$ entries.  In the default settings for
DsTool, we have the bounds $4\le N \le 13$.  The value $4$ is 
fixed, as DsTool needs at least $3$ ``system'' colors\index{colors, system}, and at least
one color for alternating colors\index{colors, alternating}.  The value 
$13$ is variable, and depends upon the value of the constant 
\unix{MAX\_DSCOLOR} in the file
\unix{\$DSTOOL/src/include/dscolor.h}. 
Entries 0, 1, 2 of the colormap are reserved for system
colors Red, Green, Blue, respectively.  The alternating color
cycles through entries 3 through $N-1$, while pick color can use any entry 0
through $N-1$.  The available colors are displayed and can the 
pick color be selected in the Color window.
 
Each point that is stored in memory has three color (integer) entries.
They are used to designate how the point is displayed in 2-D View
windows.  Points sent to Geomview via the 3-D View window are always 
displayed with dots, and points displayed in 1-D View windows are always 
connected with lines.
The first color field contains the alternating color for the point, the
second color field contains the pick color, and the third color field
contains the symbol code.  If the alternating color is
a positive number, and the pick color setting on the
2-D or 3-D View window is off, then the point is plotted with the corresponding
alternating color of the colormap.  If the alternating color
is negative, or the pick color
setting of the 2-D or 3-D View window is on, then the point is plotted
with the pick color.  Regardless of the pick color setting, the point 
is plotted in 2-D View windows with the symbol determined by the symbol code.
 
\subsection{Color Coding for Points}
 
This section details how points are assigned colors\index{color, coding} and symbols\index{symbol, coding}. 
 
\begin{description}
\item [Colors for Trajectories:] Trajectories (and multiple trajectories) 
     have both an alternating
     color and a pick color.  The pick color can be chosen by the user
     using the Color window.  The alternating color is automatically 
     the next (non-system) color in the colormap. 
     Each trajectory of a 
     flow object is colored using the same alternating and pick colors.   
     The default symbol (shown in the Defaults window) is always assigned.
 
\item [Colors for fixed points:]
     The DsTool convention\index{color, DsTool convention} for hyperbolic fixed points is: 
     saddle points are marked as green crosses, sinks are
     blue triangles, and sources are red squares.  In each case, the alternating
     color is negative, and the pick color and symbol code are the appropriate 
     integers.
     Hyperbolic fixed points that are found by the Fixed Points window always
     follow the convention.  Hyperbolic equilibrium points that are 
     found by the Equilibrium Continuation window may or may not be colored
     according to the convention, depending upon the value of the Monitor 
     Switch setting.
     In either setting, the equilibrium points are assigned dots, save those found
     by the ``Search'' operation, which are assigned triangles.
%     In either case, the symbol is a dot. 
%     Fixed points that are found by the ``Search'' operation are given a triangle.  
 
\item [Colors for periodic orbits:] Periodic orbits are colored using the DsTool
     convention: attracting periodic orbits are colored blue, repelling periodic orbits
     are colored red, and saddle periodic orbits are colored green.  Periodic orbits
     are always assigned dots.
 
\item [Colors for bifurcation points:] Bifurcation points found by the Equilibrium 
     Continuation window will be colored according
     to the colors in the Continuation Colors window. 
     Saddle node bifurcation points are colored green.  Hopf bifurcation 
     points, degenerate Hopf points, and resonant saddle node points are colored 
     using the last three colors in the colormap, which can 
     be changed by the user.  In the default
     colormap, the corresponding colors are magenta, orange, and 
     sea green, respectively.  
     Bifurcation points are always assigned dots, save those found by the ``Search''
     operation, which are assigned triangles.
    
\item [Colors for selected points:]  Points which are saved from the Selected Point
     window are assigned the pick color designated by the Color window, negative alternating
     color, and the default symbol.
\end{description}
 
 
\subsection{Setting Up a User Defined Colormap}\index{colormap, user-defined}
 
%By default, DsTool's colormap is defined in the DsColor struct
%named ``dscolor'' in the file dscolor.c 
DsTool has a default colormap which it will use if the user does not
provide one.  
To provide a colormap, the user must define it in a file 
named ``rgb\_color.txt''.  DsTool will check for this file first
in the directory specified by the UNIX environmental variable \unix{MY\_DSTOOL}.
If this fails, DsTool tries in the \unix{DSTOOL}
directory, and finally in the current working directory.   If the file 
is not found in any of these places, the default colormap will be used.  
%The file must be in the following format:
An example colormap looks like:
 
\begin{verbatim}
        6        
        
        255   0   0  
        0 255   0   
        0   0 255  
        238 130 238  
        255 165   0  
        190 190 190  
\end{verbatim}
 
   The first line gives the number of entries.  This number must be correct.
The next lines give the colors of the colormap, by specifying for each color
an RGB triple.  That is, each line consists of three integers between 0 and 
255, which give the red, green, and blue components of the color.
The file must not have any extraneous information such as comments, though
it can have extra white space.
 
    It is recommended that you use a colormap with at least six entries 
in it.  This will ensure that all bifurcation phenomena that DsTool can detect
will use colors different from the system colors. 
A colormap with less than four entries will not load, and DsTool 
will use the default colormap.

