|
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:
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.
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
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. |
|
|
See Also:
|