WXP
User's Guide
output <<
colors
>> graphics

Graphics Color Resources

Colors and Color Table File

The colors used by WXP are defined in the wxp.clr color table file and are read in by the program shortly after the graphics window opens.  The colors are specified by a color name and the appropriate RGB color fractions (0-1).  For example:

   name      red    green   blue
   Black      0.0     0.0     0.0
White 1.0 1.0 1.0
Red 0.7 0.0 0.0
Green 0.0 0.7 0.0
Blue 0.0 0.0 0.7
Yellow 1.0 1.0 0.3
Cyan 0.0 0.7 0.7
Magenta 0.7 0.0 0.7
DGray 0.3 0.3 0.3
LGray 0.7 0.7 0.7
LRed 1.0 0.3 0.3
LGreen 0.3 1.0 0.3
LBlue 0.3 0.3 1.0
Brown 0.7 0.7 0.0
LCyan 0.3 1.0 1.0
LMagenta 1.0 0.3 1.0

Even though only 16 colors are specified, a total of 500 colors can be allocated. To change the color table, the color_table can be specified with a new color table filename that is formatted the same as the above list. More than one color table can be listed separated by commas.  The programs use color names based on the default color table so it is useful to have these colors in any color table that is used. 

Color Tables and the Color Fill Resource

In most cases, the color_fill resource is set manually.  This resource defines a set or range of colors to use in color fill contours.  In most cases, the color fill resource is set to a range of colors in the color table such as "black-lmagenta".  To simplify the process, the color fill resource is automatically set to the colors in the first color table file specified in the color_table resource.   For example:

   -ct=rainbow.clr,wxp.clr

If the rainbow.clr color table file has 24 colors, the color fill resource is set to use all of those colors by default.  If the rainbow color table has colors that shouldn't be in the fill specification, the keyword "end" can be inserted into the file after the last color to be used in the color fill.

   ...
MBRed 0.8 0. 0.
MRed 0.6 0. 0.
DRed 0.4 0. 0.
End White 1. 1. 1. ...

Colors and Color Resources

Each type of graphic whether it is a line or text will be plotted in a specific color based on the above list.  The colors can be changed by specifying the appropriate resource for that graphical item. For example, the color_map resource is used to change the color of the background map from the default "red".  The resource can be specified on the command line:

   sfcplot -com=lblue

to change the color of the map to light blue. The color name "Off" can be specified to turn the display off for that particular piece of information.

Graphics Resources and Attributes

WXP graphics programs will recognize attribute descriptions appended to the end of the various color resources. These attributes include line width, style, fill patterns, text width, height and thickness. The color resource syntax is:

   color[:attrib...]

Here is a list of the possible attributes:

Attribute Description
co=color Specifies the color.  This is the color name from the color table.  If this is the first attribute, the "co=" may be omitted.
wi=width Specifies the width of lines.  This includes lines used in text and markers. The default value is 1.0.
sh=width
Specifies the width of the drop shadowing.
st=style Specifies the style of lines.  Possible values are:
  • sol - solid lines (number 1)
  • dsh - dashed lines (number 2)
  • lsdsh - long short dashed lines (number 3)
  • llsdsh - long, long, short dashed lines (number 4)
  • dot - dotted lines (number 5)
  • # - a number corresponding to the above styles
fo=font Specifies the font name.  See the font_list resource.
fi=fill
fp=fill
Specifies the fill pattern. Possible values are:
  • sol - solid fill (number 0)
  • st - stippled fill (number 1)
  • ost - open stippled (number 2)
  • rst - random stipple (number 3)
  • lst - large stipple (number 4)
  • vln or || - vertical lines (number 5)
  • drl or // - diagonal lines moving to upper right (number 6)
  • dlr or \\ - diagonal lines moving to lower right (number 7)
  • hln or -- - horizontal lines (number 8)
  • hat or XX - hatched lines (number 9)
  • 0% - 0 % fill (number 10)
  • 1% - 11% fill (number 11)
  • 2% - 22% fill (number 12)
  • 3% - 33% fill (number 13)
  • 4% - 44% fill (number 14)
  • 5% - 55% fill (number 15)
  • 6% - 66% fill (number 16)
  • 7% - 77% fill (number 17)
  • 8% - 88% fill (number 18)
  • 9% - 100 % fill (number 19)
  • ## - a number associated with the above patterns
sc=scale
hi=height
Specifies the scale factor.  For text, this is the text height. For markers, this is the size of the marker. The default value is 1.0.
te=expan Specifies the text expansion factor. This controls how wide text is plotted. An expansion factor greater than 1 results in fat text. A value less than 1 results in thin text. The default value is 1.0.

Fill Contour Colors and Attributes

The color_fill resource allows a great deal of tailoring of contour plots and satellite images. The syntax for each color fill parameter is:

   [value:]color[:attribute...]

In the simplest form, the color fill list is just a list of colors to be used by the program to display color fill contours.  The first color is associated with the lowest contour value unless changed with the con_base resource.

   magenta,lmagenta,blue,lblue,cyan,lcyan,green,lgreen,
   brown,yellow,red,lred,dgray,lgray,white

Each color may also have attributes listed that modify the appearance of the color fill contours.

   dgray:fi=vln,dgray

which uses a different fill pattern for the first color fill range. This can be used in conjunction with line contours if the color_cont resource is set to "off". These attributes can be used to tailor the lines:

brown,brown:st=dot,brown:st=dot,brown:st=dot,brown:st=dot

which is used to make every 5th line solid and all others dotted.

Color ranges may also be specified to simplify the list. For example:

   red-blue

would be equivalent to red,green,blue using the color table listed above. The attributes for the entire range come from the attributes listed for the first color in the range.

Finally, values can be attached to each color fill value.  This locks in a particular color to a specific contour range and can specify contour values that are not regular and thus cannot be specified with the con_interval resource.

   .01:DDMagenta,.05:DMagenta,.1:MMagenta,.175:BMagenta,.25:Blue,
.375:LBlue,.5:Green,.75:LGreen,1:Brown,1.5:Yellow,2:Red,
3:Lred,4:LGray

This specifies the color fills for a precipitation field.

As color fill settings get more complicated, it becomes more convenient to put the values in a file. WXP has a color fill file that can be specified with the color_fill resource:

   -cof=prec.cfl

The file has the same information except the values are put of different lines without the commas:

   .01:DDMagenta
.05:DMagenta
.1:MMagenta
.175:BMagenta
.25:Blue
.375:LBlue
.5:Green
.75:LGreen
1:Brown
1.5:Yellow
2:Red
3:Lred
4:LGray

Up to 256 color fill values can be specified.

Satellite Enhancement

The satplot program uses a slightly different syntax for color fills.  Satellite enhancement uses the existing color fill setup where values can be specified for colors. The major differences are as follows:

The color fill file or more appropriately the enhancement file has an additional line at the beginning of the file that names the enhancement. Here is the MB enhancement file:

   MB
0:black
c29:1
2-9
c6:10
11-15
c-31:16
c-32:cyan
c-43:lcyan
c-54:lblue
c-60:blue
c-64:green
c-70:lgreen
c-76:brown
c-81:yellow
c-90:black

Last updated July 21, 1998

output <<
colors
>> graphics