/**
* color转image
*/
- (UIImage*)createImageWithColor: (UIColor*)color
{
CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/3322.html