Programming with Quartz: 2D and PDF Graphics in Mac OS X

Chapter 7: Color, Alpha Transparency, and the Quartz Graphics State

A color in Quartz consists of a color space, a set of component values, and an alpha value. The color space determines the number of color components and how the components are interpreted. The alpha value determines the transparency of a color. Alpha transparency is one of the distinguishing features of the Quartz drawing model. Not only does every color have an associated alpha value, but Quartz supports a global alpha, an additional transparency value that can be applied to all drawing.

Quartz offers a wide variety of color models for painting graphics. Because ColorSync color management is integrated into Quartz, it's easy to use calibrated colors and color spaces for drawing, producing consistent color fidelity across a wide range of devices.

The graphics state is a set of drawing parameters that affect how Quartz renders graphics. Fill and stroke colors are included in this set along with the current transformation matrix (CTM), the clipping area, the font, and more than a dozen other parameters. Each has a default setting you can override by calling the Quartz function designed to set that parameter value. Some of these parameters line cap, line join, and miter limit, for example you've already looked at in detail. This chapter gathers all the graphics state parameters in one place so that you can see exactly what's handled by the graphics state, how to change the parameters, and how to save and restore them.

Color and Color Spaces

Color component values are meaningless without a color space...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Color Meters and Appearance Instruments
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.