CGShading is a CoreGraphics API that allows drawing of either linear or radial gradients.
http://developer.apple.com/documentation/GraphicsImaging/Reference/Quartz_2D_Ref/qref_main/function_group_27.html
Apple also provides some sample code: http://developer.apple.com/samplecode/Cocoa_CG_shading_demo/Cocoa_CG_shading_demo.html
OT - This line is great: “While the project itself is Cocoa based, the CG code contained within the drawRect: method is straightforward, easily reused”