iOS 根据颜色返回图片

颜色-》图片
UIGraphicsBeginImageContext(CGSizeMake(1, 1));
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, color.CGColor);
CGContextFillRect(context, CGRectMake(0, 0, 1, 1));
UIImage *result =  UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

posted on 2015-12-11 09:24  iOS-bin  阅读(75)  评论(0)    收藏  举报

导航