|IDL Reference Guide: Procedures and Functions|
The ERASE procedure erases the screen of the currently selected graphics device (or starts a new page if the device is a printer). The device is reset to alphanumeric mode if it has such a mode (e.g., Tektronix terminals).
ERASE [, Background_Color] [, CHANNEL=value] [, COLOR=value]
The color index or 24-bit color value to which the screen will be erased. If this argument is omitted, ERASE resets the screen to the default background color stored in the system variable !P.BACKGROUND. Providing a value for Background_Color overrides the default.
If the display device supports 24-bit color, Background_Color can be a 24-bit integer color specification. When specifying a 24-bit color, the DECOMPOSED keyword to the DEVICE routine should be set equal to 1; if DECOMPOSED=0, the lower 8 bits of the color are used to index the current color table to determine the erase color.
24-bit color values are commonly represented using hexadecimal notation. Generally speaking, a 24-bit color specification to ERASE takes the form
Not all devices have the ability to erase to a specific background color.
The channel or channel mask for the erase operation. This parameter has meaning only when used with devices that support TrueColor or multiple-display channels. The default value is !P.CHANNEL.
Specifies the background color. Using this keyword is analogous to using the Background_Color argument.
Display a simple image in the current window, then erase it:
TV, DIST(255) ; Erase the image from the window: ERASE
If the current display device uses decomposed color, the following will erase the screen using green, then plot in blue:
ERASE, '00FF00'x PLOT, INDGEN(10), COLOR='FF0000'x, /NOERASE
With the plot still on screen, the following command will change just the green channel: