+ (UIImage *)p_w_picpathWithColor:(UIColor *)color size:(CGSize)size
{
@autoreleasepool {
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, color.CGColor);
CGContextFillRect(context, rect);
UIImage *p_w_picpath = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return p_w_picpath;
}
}
转载于:https://blog.51cto.com/8386217/1581959