Step 2: Assign Initial Attributes

The runtime selects a background intensity. Because your program does not control this, the runtime relies solely on configuration options to do this. If you do not set any options, the runtime uses a default intensity based on your hardware and operating environment.

You may choose your own intensity by using the BACKGROUND_INTENSITY configuration variable. It can be set to one of the values 0, 1 or 2.

There are two important exceptions:

After setting the initial background intensity, the runtime selects the initial foreground intensity. If your program specifies an intensity, then that is the intensity used.

If your program uses the default intensity, then the setting of the configuration option FOREGROUND_INTENSITY determines the intensity:

If your program specifies a default intensity, the runtime will never assign high-intensity if the foreground is black. As with the background, we do this to prevent a washed-out appearance. There's one exception to this rule. The runtime will assign high-intensity to a black foreground if the output device does not support independent background intensities. In this case, the device will typically show the background in high-intensity and keep the foreground black. Note that if your program explicitly sets high-intensity, then that will be used regardless of the foreground color.