title: How to make one colour transparent in UIImage
body: <p>I want to change a colour in UIimage to transparent
   I am using below code to change black colour to transparent </p>
  
  <pre><code>-(void)changeColorToTransparent: (UIImage *)image{
      CGImageRef rawImageRef = image.CGImage;
      const float colorMasking[6] = { 0, 0, 0, 0, 0, 0 };
      UIGraphicsBeginImageContext(image.size);
      CGImageRef maskedImageRef =  CGImageCreateWithMaskingColors(rawImageRef, colorMasking);
     {
         CGContextTranslateCTM(UIGraphicsGetCurrentContext(), 0.0, image.size.height);
         CGContextScaleCTM(UIGraphicsGetCurrentContext(), 1.0, -1.0);
     }
  
     CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, image.size.width, image.size.height), maskedImageRef);
     UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
     CGImageRelease(maskedImageRef);
     UIGraphicsEndImageContext();
   }
  </code></pre>
  
  <p>Its working fine..
  But i want to draw a point on image by picking the colour form colour picker and then    wants to make that point transparent..
  I dont know how to give values in colour masking in below line </p>
  
  <pre><code>const float colorMasking[6] = { 0, 0, 0, 0, 0, 0 };
  </code></pre>
  
  <p>Can any one please help me how we can make a colour to transparent</p>