I used this as the basis of a feature that dims the screen outside a circle area which is left unaltered:
Mask a UIView with a cut-out circle
But what I would like to do is to optionally tint the circle red, but all my attempts have failed. Where am I going wrong please ?
[[self fillColor] set];
UIRectFill(rect);
CGContextRef context = UIGraphicsGetCurrentContext();
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect: self.circleFrame];
if (self.tintCircle)
{
float red[4] = {1,0,0,1};
CGContextSetFillColor(context, red);
[path fill];
}
else
{
[path fillWithBlendMode:kCGBlendModeDestinationOut alpha:1.0];
}