title: Use UIImage as a mask to fill with different colors
body: <p>I found this code <a href="https://stackoverflow.com/questions/845278/overlaying-a-uiimage-with-a-color">here</a>, but am unsure how to use it.</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect
  {
      CGRect bounds = [self bounds];
      [[UIColor blackColor] set];
      CGContextRef context = UIGraphicsGetCurrentContext();
      CGContextClipToMask(context, bounds, [myImage CGImage]);
      CGContextFillRect(context, bounds);
  }
  </code></pre>
  
  <p>Am I subclassing a UIImage?  Where does drawRect need to be called?  Thanks</p>