Color scales are used in PDP++ to display the values of variables graphically in various types of displays. The choice of color scale depends on personal preferences as well as what type of display the user has available. There are a number of different types of color scales that come with the software, and the user can create their own custom colorscales.
A color scale is specified by creating a set of different color points.
The actual scale is just the linear interpolation between each of these
points, where the points are distributed evenly through the range of
values covered by the scale. Thus, if there were three such points in a
color specification that goes from -1 to 1, the first point would
represent the value -1, the middle one would represent 0, and the last
one would represent 1. Values in between would be represented by
intermediate colors between these points. The actual number of colors
created in a given color scale is determined by the
color_scale_size
setting parameter for color displays, and
mono_scale_size
for monochrome displays (see section 6.17 Settings Affecting GUI Behavior).
The PDPRoot object contains a group of color specifications called
.colorspecs
, which is where the default color scales and any new
ones the user creates are located. The default element
(see section 8.2 Groups) of this group represents the default color scale to
use when creating a new display that uses color scales. The defaults are
as follows:
C_ColdHot
C_BlueBlackRed
C_BlueGreyRed
C_BlueWhiteRed
C_BlueGreenRed
C_Rainbow
C_ROYGBIV
C_DarkLight
C_LightDark
M_DarkLight
M_LightDark
M_LightDarkLight
P_DarkLight
P_DarkLight_bright
P_LightDark
P_DarkLightDark
P_LightDarkLight
The ColorScaleSpec is the object that specifies the color scale. It contains a group of RGBA objects, each of which is used to specify a point on the colorscale range based on the Red, Green, and Blue values, plus a "transparency" parameter Alpha. The ColorScaleSpec object has one primary function.
GenRanges (ColorGroup* cl, int nper)
The RGBA object has the following fields:
String name
float r
float g
float b
float a
If the name field of an RGBA object is set, then it will try to lookup the name to find the r,g, and b values for that color.
Thus, to create your own color scale specification, just create a new
ColorScaleSpec object, and then create some number of RGBA objects in
it. Then, edit your views (e.g., the network view, section 10.6 Network Viewer), and
set their colorspec
to point to your new specification. In order
to see changes you make to your color spec, you need to switch the
colorspec
pointer to a different one and then back to yours after
making the changes.