Cggradientref tablebackgroundgradient ()
{
Static cggradientref layoutgradient = NULL;
If (! Layoutgradient)
{
Uicolor * contentcolortop = [uicolor colorwithred: 0.90 Green: 0.92 Blue: 0.95 ALPHA: 1.0];
Uicolor * contentcolorbottom = [uicolor colorwithred: 0.70 Green: 0.72 Blue: 0.75 ALPHA: 1.0];
Cgcolorspaceref colorspace
= Cgcolorspacecreatedevicergb ();
Cgfloat backgroundcolorcomponents [3] [4];
Memcpy (
Backgroundcolorcomponents [0],
Cgcolorgetcomponents (contentcolortop. cgcolor ),
Sizeof (cgfloat) * 4 );
Memcpy (
Backgroundcolorcomponents [1],
Cgcolorgetcomponents (contentcolorbottom. cgcolor ),
Sizeof (cgfloat) * 4 );
Const cgfloat endpointlocations [2]
= {0.0, 1.0 };
Layoutgradient =
Cggradientcreatewithcolorcomponents (
Colorspace,
(Const cgfloat *) backgroundcolorcomponents,
Endpointlocations,
2 );
Cfrelease (colorspace );
}
Return layoutgradient;
}