title: iOS Brush Hardness like Photoshop
body: <p>How to get the following brush smoothness(hardness) effect like photoshop?
  <img src="https://i1245.photobucket.com/albums/gg597/protech814/347daec3.png" alt=""></p>
  
  <p>My attempt:</p>
  
  <pre><code>CGContextRef context = UIGraphicsGetCurrentContext(); 
  CGContextSaveGState(context);
  CGContextSetLineCap(context, kCGLineCapRound);
  CGContextSetLineWidth(context, 30);
  CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:1.0f green:0.0f blue:0.0f alpha:0.5f].CGColor);
  CGContextSetShadowWithColor(context, CGSizeMake(0, 0), 20.0f, [UIColor colorWithRed:1.0f green:0.0f blue:0.0f alpha:1.0f].CGColor);
  CGContextAddPath(context, path);
  CGContextStrokePath(context);
  CGContextRestoreGState(context);
  </code></pre>
  
  <p>I tried adjusting alpha values, and shadow blur factor, but no successful result.</p>
  
  <p>Does anybody have a solution to this? Any help would be appreciated.</p>