Customizing Colors in UNIX Environments

Methods for Customizing the Color Settings in Your SAS Session

SAS provides a default set of colors and attribute settings for the elements of all SAS windows. You can customize the colors in your SAS session in the following ways:

Customizing Colors by Using the SASCOLOR Window

You can use the SASCOLOR window to change the color and highlighting of specific elements of SAS windows. To open the SASCOLOR window, issue the SASCOLOR command or select Toolsthen selectOptionsthen selectColors:
SASCOLOR Window
SASCOLOR Window
To change a color for a window element, select the element name, and then select color and attribute that you want assigned to the element.
The BLINK attribute is not supported. The HIGHLIGHT attribute causes text to be displayed in bold font.
When you click Save, your changes are saved to the catalog entry SASUSER.PROFILE.SAS.CPARMS.
Note: Close and reopen any active windows for new color settings to take effect.
For more information about the SASCOLOR window, see the online SAS Help and Documentation.

Syntax of the COLOR Command

You can use the COLOR command to set the color for specific elements of the active window:
color field-type <color|NEXT <highlight>>
field-type
specifies an area of the window such as background, command, border, message, and so on.
color
specifies a color such as blue (which can be abbreviated B), red (R), green (G), cyan (C), pink (P), yellow (Y), white (W), black (K), magenta (M), gray (A), brown (B), or orange (O).
NEXT
changes the color to the next available color.
highlight
can be H (which causes text to be displayed in a bold font), U (underlined), or R (reverse video). The BLINK attribute is not supported.
To save your changes, issue the WSAVE command. The changes are saved to SASUSER.PROFILE.window.WSAVE.
Note: The WSAVE command is not available for all SAS windows. For example, with SAS/FSP changes are saved either through the EDPARMS or the PARMS window. (To determine whether WSAVE is available for a SAS window, refer to the product documentation.)
For more information about the COLOR and WSAVE commands, see the online SAS Help and Documentation.

Defining Color Resources

Types of Color Resources

Color resources fall into two categories:
  • foreground and background definitions
    These resources enable you to customize the RGB values that are used to define the 12 DMS colors. Because each color could be used as either a background or a foreground color, you can specify different RGB values or color names for each color for each usage. For example, you can specify that when blue is used as a foreground color, color #0046ED is used, and when blue is used as a background color, CornflowerBlue is used.
  • window element definitions
    These resources, which are referred to as CPARMS resources, enable you to specify which of the 12 DMS colors you want to use for each window element. For example, you can specify that message text is displayed in magenta.
These two types of resources work together. The CPARMS color values use the current foreground and background definitions. For example, the following resources specify that the background of your primary windows will be CornflowerBlue:
SAS.blueBackgroundColor: CornflowerBlue
SAS.cparmBackground: DmBlue

Specifying RGB Values or Color Names for Foreground and Background Resources

SAS uses SAS.systemBackground, SAS.systemForeground, and the resources listed in the following table to determine the colors to be used in its windows.
SAS.systemForeground: color
specifies the color for the foreground system color in the SASCOLOR window.
SAS.systemBackground: color
specifies the color for the background system color in the SASCOLOR window.
SAS.systemSecondaryBackground: color
sets the system secondary background color and specifies the color for the secondary background system color in the SASCOLOR window.
You can specify color names such as MediumVioletRed or RGB values such as #0000FF for all of the foreground and background resources. See your X Window System documentation for information about RGB color values.
The following table lists all of the foreground and background color resources and their class names. All of these resources are of the type String.
Foreground and Background Color Resources
Resource Name
Class Name
SAS.systemForeground
SystemForeground
SAS.systemBackground
SystemBackground
SAS.systemSecondaryBackground
Background
SAS.blackForegroundColor
BlackForegroundColor
SAS.blueForegroundColor
BlueForegroundColor
SAS.brownForegroundColor
BrownForegroundColor
SAS.cyanForegroundColor
CyanForegroundColor
SAS.grayForegroundColor
GrayForegroundColor
SAS.greenForegroundColor
GreenForegroundColor
SAS.magentaForegroundColor
MagentaForegroundColor
SAS.orangeForegroundColor
OrangeForegroundColor
SAS.pinkForegroundColor
PinkForegroundColor
SAS.redForegroundColor
RedForegroundColor
SAS.whiteForegroundColor
WhiteForegroundColor
SAS.yellowForegroundColor
YellowForegroundColor
SAS.blackBackgroundColor
BlackBackgroundColor
SAS.blueBackgroundColor
BlueBackgroundColor
SAS.brownBackgroundColor
BrownBackgroundColor
SAS.cyanBackgroundColor
CyanBackgroundColor
SAS.grayBackgroundColor
GrayBackgroundColor
SAS.greenBackgroundColor
GreenBackgroundColor
SAS.magentaBackgroundColor
MagentaBackgroundColor
SAS.orangeBackgroundColor
OrangeBackgroundColor
SAS.pinkBackgroundColor
PinkBackgroundColor
SAS.redBackgroundColor
RedBackgroundColor
SAS.whiteBackgroundColor
WhiteBackgroundColor
SAS.yellowBackgroundColor
YellowBackgroundColor

Defining Colors and Attributes for Window Elements (CPARMS)

You can define the colors and attributes for specific window elements by assigning values to SAS resources known as CPARMS. Each CPARMS resource defines the color and attribute of a specific window element, such as the background in a secondary window or the border of a primary window.
You can specify multiple color and attribute names in the same resource definition, but only the final color and attribute will be used:
SAS.cparmResource: DmColorName|DmAttrName\
<+DmColorName|DmAttrName>
Resource can be any of the CPARMS resources listed in the following table. All of these resources are of type DmColor, and their default values are dynamic–that is, the default values are determined at run time.
SAS CPARMS Resources
Resource Name
Color and attribute settings
Class Name
Default Color
SAS.cparmBackground
for backgrounds within all primary windows displayed in a SAS session.
CparmBackground
DmWhite
SAS.cparmBanner
for a banner within a window.
CparmForeground
DmBlack
SAS.cparmBorder
for the border of a primary window.
CparmBackground
DmBlack
SAS.cparmByline
for BY lines written to the Output window.
CparmForeground
DmBlue
SAS.cparmColumn
for text labels for column information. You can use this resource within the SAS editor to identify editing lines and in spreadsheet windows to label spreadsheets.
CparmForeground
DmBlue/ Underline
SAS.cparmCommand
for the command data entry field when menus are disabled.
CparmForeground
DmBlack
SAS.cparmData
for general lines written to the Log window or the Output window.
CparmForeground
DmBlack
SAS.cparmError
for ERROR lines that are written to the Log window or Output window.
CparmForeground
DmRed
SAS.cparmFootnote
for FOOTNOTE lines written to the Output window.
CparmForeground
DmBlue
SAS.cparmForeground
for all text fields within a SAS windowing environment window that can be edited.
CparmBackground
DmBlack
SAS.cparmHeader
for HEADER lines written to the Output window.
CparmForeground
DmBlue
SAS.cparmHelpLink
for links to additional levels of information in the Help system.
CparmForeground
DmGreen/ Underline
SAS.cparmHelpMainTopic
for topic words or phrases in the Help system.
CparmForeground
DmBlack
SAS.cparmHelpSubTopic
for topic words or phrases in the Help system.
CparmForeground
DmBlack
SAS.cparmInfo
for text that is displayed in a window as an aid to the user. For example:
Press Enter to continue
CparmForeground
DmBlack
SAS.cparmLabel
for text that precedes a widget. For example, the text Name: in the following example is a label:
Name: _______________
CparmForeground
DmBlack
SAS.cparmMark
for areas that have been selected for operations such as FIND, CUT, and COPY.
CparmForeground
DmBlack/ DmReverse
SAS.cparmMessage
for the message field.
CparmForeground
DmRed
SAS.cparmNote
for NOTE lines that are written to the Log window or the Output window.
CparmForeground
DmBlue
SAS.cparmSecondaryBackground
for backgrounds in secondary windows.
CparmForeground
DmGray
SAS.cparmSecondaryBorder
for the border of a secondary window.
CparmForeground
DmBlack
SAS.cparmSource
for SAS source lines that are written to the Log window.
CparmForeground
DmBlack
SAS.cparmText
for text labels for row information. You can use this resource within the SAS editor to identify editing lines and in spreadsheet windows to label spreadsheet rows.
CparmForeground
DmBlue
SAS.cparmTitle
for TITLE lines written to the Output window.
CparmForeground
DmBlue
SAS.cparmWarning
for WARNING lines written to the Log window or the Output window.
CparmForeground
DmGreen
DmColorName can be any one of the following colors:
  • DmBLUE
  • DmRED
  • DmPINK
  • DmGREEN
  • DmCYAN
  • DmYELLOW
  • DmWHITE
  • DmORANGE
  • DmBLACK
  • DmMAGENTA
  • DmGRAY
  • DmBROWN
DmAttrName can be any one of the following attributes:
  • DmHIGHLIGHT
  • DmUNDERLINE
  • DmREVERSE
For example, the following resources specify that all background colors are gray and all foreground colors are black:
SAS.cparmBackground: DmGRAY
SAS.cparmForeground: DmBLACK
These resources specify that errors should be displayed in red with reverse video, and warnings should be displayed in yellow with reverse video and a bold font:
SAS.cparmError: DmRED + DmREVERSE
SAS.cparmWarning: DmHIGHLIGHT + DmYELLOW + DmREVERSE
SAS looks for default CPARMS resources in two places:
  • If your on-site SAS support personnel entered color and attribute settings in the SASHELP.BASE.SAS.CPARMS catalog entry, then these settings become the default for your site.
  • If you saved settings in SASUSER.PROFILE.SAS.CPARMS, then these settings override the settings specified for your site.

Controlling Contrast

During interactive move or stretch operations, such as rubber banding and dragging rectangles in SAS/INSIGHT software, you might find it hard to see the outline of the graphics primitive because of the lack of contrast between the primitive and the background. The XCONTRAST command makes the primitive visible against the background. The rendering performance and the aesthetic appearance of the primitive is compromised for the sake of visibility. You can enter XCONTRAST to act as a toggle, or you can specify XCONTRAST ON or XCONTRAST OFF.
In some color combinations, text fields, buttons, check boxes, and other foreground categories might not be visible. The SAS.dmsContrastCheck resource makes these categories legible.
SAS.dmsContrastCheck: True | False
controls whether contrast mapping is applied to non-graphic foreground colors in a SAS window. The default value is False. A value of True specifies that DMS foreground colors will be remapped if necessary to produce a contrast. Some color usage based on graphic operations are not affected by this resource.