AKTagsInputView icon indicating copy to clipboard operation
AKTagsInputView copied to clipboard

Appearance customization interface needed

Open kas-kad opened this issue 10 years ago • 1 comments

  • replace all colored images with runtime alpha mask filling
  • other color settings

kas-kad avatar Feb 24 '15 06:02 kas-kad

here is the code to use

- (UIImage *)fillAlphaMaskWithColor:(UIColor *)color
{
    UIImage *image = self;
    CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);

    UIGraphicsBeginImageContextWithOptions(rect.size, NO, [UIScreen mainScreen].scale);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSaveGState(context);

    [color setFill];
    CGContextFillRect(context, rect);

    CGContextSetBlendMode(context, kCGBlendModeNormal);
    [image drawInRect: rect blendMode:kCGBlendModeDestinationIn alpha:1];

    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return img;
}

kas-kad avatar Feb 24 '15 06:02 kas-kad