/
UIColor to UIImage

UIColor to UIImage

+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size
{
    CGRect rect=CGRectMake(0.0f, 0.0f, size.width, size.height);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
}

Related content

UIGetScreenImage
UIGetScreenImage
More like this
Image Dimension
Image Dimension
More like this
UIImage圆角
UIImage圆角
More like this
UIEdgeInsets
UIEdgeInsets
More like this
NSMutableAttributedString
NSMutableAttributedString
More like this
NSString+MD5
NSString+MD5
More like this