Once an attribute has been changed by a call to the appropriate routine, it remains in effect for all subsequent plotting until it is changed again. These make it possible to write subroutines which change attribute values temporarily but restore the old attributes before returning to the calling program.
Devices differ considerably in their ability to draw in more than one color.
On most hardcopy devices, the default color is black on a white background, while on most CRT devices, it is white on a black background. Color is selected using an integer parameter called the color index . Color index 1 is the default color, and color index 0 is the background color. The number of different color indices available depends on the device. On most monochrome devices, only color indices 0 and 1 are available, while some color CRT devices may permit color indices from 0 to 255.