Color gradient for iOS two-dimensional drawing
Last Update:2015-05-04
Source: Internet
Author: User
<span id="Label3"></p>Color gradient for iOS two-dimensional drawing<br>Color space CMYK printing industry RGB Gradient color: linear gradient, circular gradient linear gradient: the area of the gradient is the current context, perpendicular to the StartPoint <-> endpoint segment, and a line loop gradient that intersects this segment:<br>Corefoundation (c)--foundation (oc) conversion cast: __bridge ID (type)<br>/****/automatic Reference Counting<br>Save drawing picture Create image Context-get Canvas--......--get picture-save picture-end drawing compress to picture: png (lossless compression) jpg (lossy compression)<br><br><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><span style="color:#822e0e">#import </span>"LinearGradient.h"</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#c32275">@implementation</span> LinearGradient</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px">Linear gradient</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">-(<span style="color:#c32275">void</span>) drawrect: (<span style="color:#703daa">cgrect</span>) Rect {</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#703daa">cgcontextref</span> <span style="color:#000000"> context =</span>Uigraphicsgetcurrentcontext<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#703daa">cgcolorspaceref</span> <span style="color:#000000"> colorspace =</span>Cgcolorspacecreatedevicergb<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:‘Heiti SC Light‘; color:rgb(29,148,33)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:‘Heiti SC Light‘; color:rgb(29,148,33)"><span style="font-family:Menlo; color:rgb(0,0,0)"> </span> <span style="font-family:Menlo">//</span> The component representation of the color</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cgfloat</span> components[] = {<span style="color:#0435ff">1.0</span>,<span style="color:#0435ff">0.0</span>, <span style="color:#0435ff">0.0</span>, <span style="color:#0435ff">1.0</span>, <span style="color:#0435ff">0.0</span>, <span style="color:#0435ff">0.0</span>, <span style="color:#0435ff">1.0</span>, <span style="color:#0435ff">1.0</span>, <span style="color:#0435ff">0.0</span>, <span style="color:#0435ff">1.0</span>, <span style="color:#0435ff">0.0</span>,<span style="color:#0435ff">1.0</span>};</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><span style="color:#000000"> </span>// <span style="font-family:‘Heiti SC Light‘">position of color</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cgfloat</span> locations[] = {<span style="color:#0435ff">1.0</span>,<span style="color:#0435ff">0.0</span>, <span style="color:#0435ff">0.5</span>};</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cggradientref</span> gradient = <span style="color:#3d1d81">cggradientcreatewithcolorcomponents</span>(colorspace, components, locations, <span style="color:#0435ff">3</span>);</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><span style="color:#000000"> </span>// <span style="font-family:‘Heiti SC Light‘">The area of the gradient is the current</span> context<span style="font-family:‘Heiti SC Light‘">, perpendicular to</span> the startPoint <-> endPoint line <span style="font-family:‘Heiti SC Light‘">segment, and the line that intersects this</span> line</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>cgcontextdrawlineargradient<span style="color:#000000">(context, gradient,</span>cgpointmake<span style="color:#000000"></span><span style="color:#0435ff"></span><span style="color:#000000"></span> <span style="color:#0435ff">, 0</span><span style="color:#000000">), </span>cgpointmake<span style="color:#000000">(</span><span style="color:#0435ff"></span><span style="color:#000000"></span><span style="color:#0435ff">0</span><span style="color:#000000">), </span> <span style="color:#0435ff">0</span><span style="color:#000000">);</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cgfloat</span> locations2[] = {<span style="color:#0435ff">0.4</span>,<span style="color:#0435ff">1.0</span>};</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cggradientref</span> gradient2 = <span style="color:#3d1d81">cggradientcreatewithcolorcomponents</span>(colorspace, components, locations2, <span style="color:#0435ff">2</span>);</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><span style="color:#000000"> </span>// <span style="font-family:‘Heiti SC Light‘">The area of the gradient is the current</span> context<span style="font-family:‘Heiti SC Light‘">, perpendicular to</span> the startPoint <-> endPoint line <span style="font-family:‘Heiti SC Light‘">segment, and the line that intersects this</span> line</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>cgcontextdrawlineargradient<span style="color:#000000">(context, gradient2,</span>cgpointmake<span style="color:#000000"></span><span style="color:#0435ff"></span><span style="color:#000000"></span> , <span style="color:#0435ff">0</span> <span style="color:#000000">), </span>cgpointmake<span style="color:#000000">(</span><span style="color:#0435ff">310</span><span style="color:#000000">,</span><span style="color:#0435ff">0</span><span style="color:#000000">), </span> <span style="color:#0435ff">0</span><span style="color:#000000">);</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">}</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)">@end</p></p><br><br><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><span style="color:#822e0e">#import </span>"RadialGradientView.h"</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#c32275">@implementation</span> Radialgradientview</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px">Circular gradient</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px">-(<span style="color:rgb(195,34,117)">void</span>) drawrect: (<span style="color:rgb(112,61,170)">cgrect</span>) Rect {</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#703daa">cgcontextref</span> <span style="color:#000000"> context =</span>Uigraphicsgetcurrentcontext<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#703daa">cgcolorspaceref</span> <span style="color:#000000"> colorspace =</span>Cgcolorspacecreatedevicergb<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:menlo"> <span style="color: #6122ae">nsarray </span> *array = <span style="color: #0435ff">@[</span> ( <span style="color: #c32275">__bridge </span> <span style="color: #c32275">id </span>) [<span style="color: #6122ae">uicolor </span> <span style="color: #3d1d81">redcolor </span>]. <span style="color: #703daa">cgcolor </span>, (<span style="color: #c32275">__bridge </span> <span style="color: #c32275">id </span>) [<span style="color: #6122ae">uicolor </span> <span style="color: #3d1d81">bluecolor </span>]. <span style="color: #703daa">cgcolor </span>, (<span style="color: #c32275">__bridge </span> <span style="color: #c32275">id </span>) [<span style="color: #6122ae">uicolor </span> <span style="color: #3d1d81">purplecolor </span>]. <span style="color: #703daa">cgcolor </span> <span style="color: #0435ff">] </span>; </p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cgfloat</span> locations[] = {<span style="color:#0435ff">0.0</span>,<span style="color:#0435ff">0.5</span>, <span style="color:#0435ff">1.0</span>};</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#703daa">cggradientref</span> gradient = <span style="color:#3d1d81">cggradientcreatewithcolors</span>(colorspace, (<span style="color:#c32275">__bridge</span><span style="color:#703daa">cfarrayref </span>) array, locations);</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>cgcontextdrawradialgradient<span style="color:#000000">(context, gradient,</span>cgpointmake<span style="color:#000000"></span><span style="color:#0435ff"></span><span style="color:#000000"></span> <span style="color:#0435ff">, </span><span style="color:#000000"> </span>, <span style="color:#0435ff">0</span><span style="color:#000000"> </span>, Cgpointmake<span style="color:#000000">(</span><span style="color:#0435ff"></span><span style="color:#000000"></span><span style="color:#0435ff"></span><span style="color:#000000">), </span> <span style="color:#0435ff"></span><span style="color:#000000"> </span> <span style="color:#0435ff">0</span><span style="color:#000000">);</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">}</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)">@end</p></p><br><br><br><br><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)">Save the drawing picture</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><span style="color:#822e0e">#import </span>"ViewController.h"</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(60,130,140)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(60,130,140)"><span style="color:#c32275">@interface</span> <span style="color:#000000"> </span>viewcontroller<span style="color:#000000"> ()</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)">@end</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><span style="color:#c32275">@implementation</span> Viewcontroller</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">-(<span style="color:#c32275">void</span>) Viewdidload {</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000">[</span><span style="color:#c32275">super</span><span style="color:#000000"></span>viewdidload<span style="color:#000000">];</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>uigraphicsbeginimagecontext<span style="color:#000000">(</span>cgsizemake<span style="color:#000000">(</span><span style="color:#0435ff"></span><span style="color:#000000"></span><span style="color:#0435ff"></span><span style="color:#000000">));</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#703daa">cgcontextref</span> <span style="color:#000000"> context =</span>Uigraphicsgetcurrentcontext<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>cgcontextsetfillcolorwithcolor<span style="color:#000000">(context, [</span><span style="color:#6122ae">uicolor</span><span style="color:#000000"></span>yellowcolor<span style="color:#000000">].</span> <span style="color:#703daa">Cgcolor</span> <span style="color:#000000">);</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>cgcontextfillrect<span style="color:#000000">(context,</span>cgrectmake<span style="color:#000000">(</span><span style="color:#0435ff">0</span><span style="color:#000000">,</span><span style="color:#0435ff">0</span><span style="color:#000000">,</span> <span style="color:#0435ff"> </span>(<span style="color:#000000">in</span><span style="color:#0435ff"></span><span style="color:#000000">));</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#6122ae">UIImage</span> <span style="color:#000000"> *image =</span>uigraphicsgetimagefromcurrentimagecontext<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span> <span style="color:#6122ae">nsdata</span> <span style="color:#000000"> *data =</span>uiimagejpegrepresentation<span style="color:#000000">(image, </span> <span style="color:#0435ff">1.0</span><span style="color:#000000">);</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(29,148,33)">NSData *data = uiimagepngrepresentation (image);</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(201,27,19)"><span style="color:#000000">[data </span> <span style="color:#3d1d81">writetofile</span><span style="color:#000000">:</span>@ "/users/apple/desktop/image.jpg"<span style="color:#000000"></span><span style="color:#3d1d81">atomically</span><span style="color:#000000">: </span> <span style="color:#c32275">YES</span><span style="color:#000000">];</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000"> </span>uigraphicsendimagecontext<span style="color:#000000">();</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">}</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">-(<span style="color:#c32275">void</span>) didreceivememorywarning {</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(61,29,129)"><span style="color:#000000">[</span><span style="color:#c32275">super</span><span style="color:#000000"></span>didreceivememorywarning<span style="color:#000000">];</span></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo">}</p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; min-height:21px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)"><p style="margin-top:0px; margin-bottom:0px; font-size:18px; font-family:Menlo; color:rgb(195,34,117)">@end</p></p><br><br><br><p><p>Color gradient for iOS two-dimensional drawing</p></p></span>