+ (UIImage *)bc_imageWithColor:(UIColor *)color
strokeColor:(UIColor *)strokeColor
size:(CGSize)size
roundCorners:(UIRectCorner)corners
radii:(CGSize)radii {
UIGraphicsBeginImageContextWithOptions(size, NO, 0);
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIBezierPath *path =
[UIBezierPath bezierPathWithRoundedRect:rect
byRoundingCorners:corners
cornerRadii:radii];
[path addClip];
[color setFill];
[path fill];
if (strokeColor) {
path.lineWidth = 1. * [UIScreen mainScreen].scale;
[strokeColor setStroke];
[path stroke];
}
UIImage *roundedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return roundedImage;
}