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

You've probably already noticed the ability Quartz has for adding shadows to the drawing it performs. The use of shadows in the Aqua user interface in Mac OS X, although subtle, gives it a feeling of depth and creates part of Aqua's distinctive look. Starting in Panther, you can use Quartz to add shadows to virtually any drawing content.
A Quartz shadow has three attributes that determine its appearance: offset, blur, and color. The offset is a distance, expressed as a CGSize, that specifies how far and in what direction the shadow is offset from the graphic. The shadow offset parameter is interpreted in Quartz base space and is unaffected by coordinate transformations.
The blur controls the diffuseness of the shadow. Values for blur must be greater than or equal to zero. A blur value of zero is a hard edge, that is, no diffuseness to the shadow. Increasing values soften the blur and make it more diffuse. As a general rule, blur values in the range of 1 3 produce a pleasing effect. You are encouraged to experiment and find values that achieve an effect you like.
The color attribute of a shadow, like any Quartz color, consists of a color space, a set of color component values in that color space, and an alpha value. The color of the shadow cast by an object need not be the same as the object...