Manuals >Installation and Customization Guide >Customizing the IC-CAP Environment
Print version of this Book (PDF file)
prevnext

Special Variables

There are two configuration files that have a different syntax than the others: iccolor and icfill. Note that the naming convention and loading of system-wide, home directory, and work directory configurations still apply. Only the internal file format differs.

Color Definitions, iccolor.cfg

The various windows comprising the IC-CAP design environment, as well as plotters, use the colors defined in the iccolor configuration. By default, these colors are read from {$ICCAP_ROOT}/config/iccolor.cfg, but can be overridden at the installation, user, or working directory level (any of which can have an iccolor file).

The iccolor file format differs from the variable=value syntax. Each line contains these major fields:

    • RGB color values
    • Color name
    • Plotter pen number

The syntax for each line is as follows:

 <Red #> <Green #> <Blue #> : <Color name> : <Pen number>

The following example illustrates the format of a typical color definition file:

R
G
B


X11 color name


Plotter pen number
0
0
0
:
black


1
255
0
0
:
red
:
2
0
255
0
:
green
:
3
0
0
255
:
blue
:
4
255
255
255
:
white
:
5
128
64
0
:


:
6








salmon
:
7

Colors are described in the first and/or second fields of this file. You can enter three RGB color values (in the range 0-255) in the first field and/or you can enter the X color name from the RGB color database (found in /usr/lib/X11/rgb.txt for Motif or /usr/openwin/lib/rgb.txt for Sun's Open Windows) in the second field. If both are entered, the RGB values take precedence, and the color name is ignored.

The last field specifies which pen number to use for hard-copy output when performing HPGL plotting. An entry in this field is required and pen numbers may be recycled and repeated.

By default, the current implementation uses shared server colors from the RGB color database and uses no privately allocated color cells for X Window displays. This is done to simplify the color specification and to promote sharing of colors. Sharing of color cells can only happen if two clients allocate read-only color cells with the same X color name or RGB values.


Note


On UNIX, we strongly recommend that you only use the names given in the RGB color database instead of explicit RGB values; on the PC, only RGB values are supported.


Because of differences in screen hardware, the same RGB values may generate different colors on different hardware. By using names from the color database, you are more likely to get colors close to the ones requested across different hardware platforms.

It is also important to note that values corresponding to color names are not fixed. Therefore, they may not be exactly the same across all platforms or correspond to an exact RGB value.


Note


Some platforms have limited color resources and some platforms may use non-shared colors, resulting in color exhaustion problems. When IC-CAP programs run into these types of color problems, the solution is to reduce the number of requested colors until color conflicts stop occurring. As an example, truncating the list of colors in iccolor.cfg to 64 colors may be a good start.


An example iccolor configuration file is shown:

 # 
============================================================
# IC-CAP Color Definition File:
# 
============================================================
#   R   G   B  :  Color Name  :  Plotter Pen #
#  --- --- ---    ----------     -------------
#   0   0   0  :    black     :       1
#  255  0   0  :    red       :       2
#   0  255  0  :    greeen    :       3
#   0   0  255 :    blue      :       4
#  255 255  0  :    yellow    :       5
#  255  0  255 :    magenta   :       6
#   0  255 255 :    cyan      :       7
#  255 255 255 :    white     :       8
#
# For Unix X Windows systems either RGB values or standard    
# X Color Names, or both, may be specified for color entries. 
# For Windows only RGB values are supported.
# Note, if both RGB and Color Name values are specified,
# the RGB  values take precedence.
# 
============================================================
#
  0   0   0 :black                 : 0 # First always black
255   0   0 :red                   : 1 # First trace color
255 255   0 :yellow                : 2 # Second trace color
  0 255   0 :green                 : 3 # Third trace color
  0 255 255 :cyan                  : 4 # Fourth trace color
  0   0 255 :blue                  : 5 # Fifth trace color
255   0 255 :magenta               : 6 # Sixth trace color
192 192 192 :gray                  : 7 # Eighth trace color
255 255 255 :white                 : 8 # Eighth always white


Note


Although not recommended, you can change the default colors in the iccolor.cfg file. The iccolor example above shows the lines that set the color for trace 1 through 6 and for trace 8. Not shown is that line 88 sets the trace 7 color, line 32 sets the Y2 trace color, and line 54 sets the Plot Optimizer region box color. For an example, see the iccap.cfg.adv file located in $ICCAP_ROOT/iccap/lib/cust_advanced.


If the IC-CAP configuration file cannot be found or the hpeesof configuration does not contain an HPEESOF_COLOR variable (which determines the location of the IC-CAP color definition file), a set of ten basic default server colors are automatically loaded as follows:

1 = black
4 = green
7 = magenta
10 = medium blue
2 = red
5 = cyan
8 = gray
 
3 = yellow
6 = blue
9 = white
 

Fill Pattern Configuration, icfill.cfg

Besides colors, plotters also use the fill patterns defined by the icfill configuration. By default, these patterns are read from {$ICCAP_ROOT}/config/icfill.cfg, but can be overwritten at the working directory or user directory (any of which can have an icfill file).

The icfill file format differs from the variable=value syntax. Each line contains two major fields.

    • Path and filename of the fill pattern
    • HPGL/2-pattern-specification

The syntax for each line is as follows:

 <Bitmap_file_location> : <Fill type> <Line spacing> <Angle>

where

    • Fill type—is the pattern inside an object's border
    • Line spacing—is the distance between the hatched lines in plotter units (where a plotter unit is typically 1/72-inch).
    • Angle—is the angle of hatch lines in the fill pattern, expressed in degrees (for fill type 3 or 4 only).

The following example illustrates the format of a typical fill pattern definition file:

Fill patterns use standard X-bitmap files that can be easily created with the X bitmap utility. The first field specifies the path to the X-bitmap file, which is used for pattern fills, while the remaining fields are the HPGL/2 fill pattern specification.

Fill type description
Fill type number
Solid bidirectional
1
Solid unidirectional
2
Hatched
3
Cross hatched
4


Note


Solid bidirectional fill is faster than solid unidirectional fill, but is not supported by all plotters.


An icfill configuration file is shown in the following example:

 #===========================================================
#EEsof Fill Pattern Definition File:
#===========================================================
#X Bitmap Filename  : Type  Spacing  Angle  (Hardcopy output)
 #-----------------    --------------------
#path/pattern_file1 :  3      70      15
#path/pattern_file2 :  4      50      45
#path/pattern_file3 :  4      45      90 
#===========================================================
#0
{$HPEESOF_DIR}/de/fill_patterns/pat1.pattern : 3 25 15 
{$HPEESOF_DIR}/de/fill_patterns/pat2.pattern : 3 25 30 
{$HPEESOF_DIR}/de/fill_patterns/pat3.pattern : 3 25 45
{$HPEESOF_DIR}/de/fill_patterns/pat4.pattern : 3 25 60
{$HPEESOF_DIR}/de/fill_patterns/pat5.pattern : 3 25 75
{$HPEESOF_DIR}/de/fill_patterns/pat6.pattern : 3 25 90
{$HPEESOF_DIR}/de/fill_patterns/pat7.pattern : 4 25 15
{$HPEESOF_DIR}/de/fill_patterns/pat8.pattern : 4 25 30

If the IC-CAP configuration file cannot be found or the hpeesof configuration does not contain an HPEESOF_FILL variable (which determines the location of the IC-CAP fill definition file), a single, unidirectional, solid fill pattern is automatically loaded.


prevnext