Home / Software Design & Engineering /X Resources Colors
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:
Some example two-digit hexadecimal RGB values (#RRGGBB - 8 bits each) follow.
!---- An off white or cream color:
!---- A pale aqua:
!---- A dusty rose:
!---- OpenWindows default background screen blue:
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:
For design tips for using color in software see our design pattern Color Is Information.