Important: The information in this document is obsolete and should not be used for new development.
RGBForeColor
To change the color of the "ink" used for framing and painting, you can use theRGBForeColor
procedure.
PROCEDURE RGBForeColor (color: RGBColor);
color
- An
RGBColor
record.DESCRIPTION
TheRGBForeColor
procedure lets you set the foreground color to any color available on the current graphics device.If the current port is defined by a
CGrafPort
record, Color QuickDraw supplies itsrgbFgColor
field with the RGB value that you specify in thecolor
parameter, and places the pixel value most closely matching that color in thefgColor
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 lists the default set of eight colors represented by the global variableQDColors
(adjusted to match the colors produced on the ImageWriter II printer.)
SPECIAL CONSIDERATIONS
Color QuickDraw ignores the foreground color (and the background 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.The
RGBForeColor
procedure is available for basic QuickDraw only in System 7.The
RGBForeColor
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 theForeColor
procedure. TheForeColor
procedure and the eight-color system of basic QuickDraw are described in the chapter "QuickDraw Drawing" in this book.To determine the current foreground color, use the
GetForeColor
procedure, which is described on page 4-70.