ABSOLUTE COLOR
Color QuickDraw, as defined in the Macintosh II ROMs, uses an absolute
approach to determine color representation. A new data type, RGBColor, is
defined to be a record containing three 16-bit integers, each of which
represents an intensity value for one of the three additive primary
colors: red, green, and blue.
type
RGBColor = record
red:integer; {Red component}
green:integer; {Green component}
blue:integer; {Blue component}
end;
Under Color QuickDraw, the application need not be concerned with the type
of output device. The application specifies a color in RGBColor format,
but the Color Manager then uses information from the device's driver to
translate the RGBColor definition into the best available match on the
output device. Some output devices may be limited to 8 or 16 colors;
others use a lookup table to select from a wide range of possible display
colors. In any event, the Color Manager handles these details
independently of Color QuickDraw or the application.
COLOR DEPTH
On the Macintosh II, the user can choose the depth to which the screen
image should be displayed, up to the limits of the video hardware, by
using the Control Panel desk accessory. This permits choosing a display
consistent with the type of program. A word processing application may
need only black and white, and a greater selection of colors (i.e.,
greater depth) would only slow down the application. On the other hand,
drawing and charting applications benefit from the ability to use more
colors, so the user might choose to use a greater pixel depth.
Pixel depth must be a power of 2. A display of 4 bits per pixel permits
each pixel to choose from among 16 colors, while 8 bits per pixel allows a
selection of 256 colors. Normally, the device implements these choices
through a color lookup table controlled by the Color Manager.
THE PIXMAP
All drawing by Color QuickDraw is done in a pixel map, which is analogous
to the bit map of old. New fields have been added to track the horizontal
and vertical resolution in pixels per inch, the number of bits per pixel,
and the handle to the pixel map's color table.
COLOR PATTERNS
Color QuickDraw includes color patterns. It provides an undefined limit to
the size of the pattern, and a variable pattern depth. Although Color
QuickDraw is capable of translating the depth of a pattern to the current
screen display depth, this can be a time-consuming process, and should be
avoided. As always, color patterns provide a method of dithering, which
increases the number of perceived colors shown on the screen.
COLOR TRANSFER MODES
Color capabilities introduce new opportunities for transfer modes. Some
previously defined transfer modes aren't useful when color display is
used, so Color QuickDraw offers new ones:
- Replace with transparency
Permits overlay of pictures
- Additive
Adds red, green and blue components on the screen, resulting in a
lighter screen image.
- Subtractive
Subtracts red, green and blue components on the screen, resulting in
a darker screen image.
- Max and min
Compares the source and destination values, and chooses either the
smaller or the larger. Used to smooth the edges of two objects displayed
next to each other.
- Blend
Uses a formula to calculate a mix of the source and destination values
of each component.