Contains a list of all the items which have an assigned color,
and the list of all the different color categories which exist. VMD uses a colormap made of 16 base colors (plus black), and a colorscale made of 1024 colors in user-definable gradient (e.g., red-green-blue, or red-white-blue). Color categories are used to contain the names of items which are related and which may have their colors changed; an example of a color category is `Axes', which contains the colors for the `X', `Y', and `Z' axes. The categories contain just a list of names and the associated colors assigned to these names (an integer, from 0 ... 16). Other objects in VMD which are derived from ColorUser can add new color categories (or can query if one of a specific name already exists), and can add new names to an existing color category. The colors assigned to the named items in each category can be changed via the Color menu, or through the color text command. Once a category is created by some ColorUser object (or, if it already exists, has been obtained by the object from ColorList), the ColorUser can use the category to retrieve the proper color to use for whatever purpose it needs it (i.e., creating the object's display list if it is a Displayable).
There are three different ways to set the colorscale:
RGB: red - green - blue.
RWB: red - white - blue.
BLK_W: dark grey - light grey.
There are sixteen colors in the colormap, along with black, for seventeen total colors. They are: blue, red, grey, orange, yellow, tan, silver, green, white pink, cyan, purple, lime, mauve, ochre, iceblue, and black.
NameList<int> colorNames - a list of all the different colors, and their corresponding colormap index.
float colorData[MAXCOLORS][COLOR_ITEMS] - the data which define each color, including all the colormap colors and the colorscale colors.
NameList<NameListIntPtr> categories - a list of all the color categories. Each category has a name, and an associated list of named items (so, first the right category is found by looking up a name in categories, and then the right color is found by looking up a name in the list associated with the given category name).
VMD contains one global instance of this class, colors. It is used by all objects derived from ColorUser, which includes all Displayable objects as well as DisplayDevice. An object which wishes to allow the user to be able to change its colors goes through these steps:
call intColorList::add_color_category(char *) ; this adds a new category with the given name and returns a unique index for that category, or else returns the index of the category if it already exists. This index should be saved for later use.
once a category exists, names should be added to the category that correspond to all the components that can be configured, with default colors. This is done by doing the following: