X Resources Colors

Colors may be set using RGB (Red Green Blue) values or color names. The RGB values syntax is #RGB where R G and B are hexadecimal numbers, This is the same syntax used in HTML for background and link colors. Research Systems recommends using color names rather than numbers because "If IDL is not able to allocate an exact color, the entire operation may fail." We believe this is less likely to occur on 24-bit color systems than 8-bit color systems.

To see all the color names on Solaris, see /usr/openwin/lib/X11/rgb.txt. On other UNIX or Linux systems the path name to this file may be /usr/lib/X11/rgb.txt. The first three fields in this file are the decimal numbers for red, green and blue respectively; the last field is the corresponding name. The Solaris CDE Color Style manager has a decimal RGB color editor. Most online calculators can translate between decimal and hexadecimal.

Some example color names:

    Idl*background: deepskyblue2
    Idl*background: gray
    Idl*background: LightGrey
    Idl*background: seagreen
    Idl*background: wheat
    Idl*background: wheat2
    Idl*background: white

Some example two-digit hexadecimal RGB values (#RRGGBB - 8 bits each) follow.

    !---- A dark blue-grey:
    Idl*background: #A0B0AF
    !---- An off white or cream color:
    Idl*background: #FFF7E9
    !---- A pale aqua:
    Idl*background: #A6C0AE
    !---- A dusty rose:
    Idl*background: #C0A6A6
    !---- OpenWindows default background screen blue:
    Idl*background: #40A0C0
On the Common Desktop Environment (CDE) the default background color is the same as an inactive window border. For example, the Solaris CDE color setting "Desert" palette uses:
    Idl*background: #C2BBA7

Note that $IDL_DIR/resource/X11/lib/app-defaults/Idl sets the background to LightGrey, which overrides the the generic background color setting for X applications on your operating system. To make your IDL applications have the same background color as your other applications, comment out the line in that file that says:

    Idl*background: LightGrey
and do not set it in your $HOME/Idl file.

For design tips for using color in software see our design pattern Color Is Information.