Important: The information in this document is obsolete and should not be used for new development.
RGBBackColor
For the current graphics port, you can use theRGBBackColor
procedure to change the background color (that is, the color of the pixels in the pixel map or bitmap where no drawing has taken place).
PROCEDURE RGBBackColor (color: RGBColor);
color
- An
RGBColor
record.DESCRIPTION
TheRGBBackColor
procedure lets you set the background color to any color available on the current graphics device.If the current port is defined by a
CGrafPort
record, Color QuickDraw supplies itsrgbBkColor
field with the RGB value that you specify in thecolor
parameter, and places the pixel value most closely matching that color in thebkColor
field. For
indexed devices, the pixel value is an index to the current device's CLUT; for direct devices, the value is the 16-bit or 32-bit equivalent to the RGB value.If the current port is defined by a
GrafPort
record, basic QuickDraw supplies itsfgColor
field with a color value determined by taking the high bit of each of the red, green, and blue components of the color that you supply in thecolor
parameter. Basic QuickDraw uses that 3-bit number to select a color from its eight-color system. Table 4-4 on page 4-62 lists the default colors.SPECIAL CONSIDERATIONS
Because a pixel pattern already contains color, Color QuickDraw ignores the background color (and the foreground color) when your application draws with a pixel pattern. You can draw with a pixel pattern by using thePenPixPat
procedure to assign a pixel pattern to the foreground pattern used by the graphics pen; by using theBackPixPat
procedure to assign a pixel pattern as the background pattern for the current color graphics port; and by using theFillCRect
,FillCOval
,FillCRoundRect
,FillCArc
,FillCRgn
, andFillCPoly
procedures to fill shapes with a pixel pattern.This procedure is available for basic QuickDraw only in System 7.
The
RGBBackColor
procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
If you want to use one of the eight predefined colors of basic QuickDraw, you can also use theBackColor
procedure. TheBackColor
procedure and the eight-color system of basic QuickDraw are described in the chapter "QuickDraw Drawing" in this book.To determine the current background color, use the
GetBackColor
procedure, which is described on page 4-71.