用于图像着色的 UIImage 分类。使用 CGBlendMode 处理图像。更多信息请参考 Apple 文档:[https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGContext/index.html#//apple_ref/c/tdef/CGBlendMode](https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGContext/index.html#//apple_ref/c/tdef/CGBlendMode)
请查看 Demo 项目,以了解如何使用 UIImage-MARKColorizer 的基本示例。
+ (UIImage *)mark_colorizeImage:(UIImage *)image
withColor:(UIColor *)color
blendMode:(CGBlendMode)blendMode;
- (UIImage *)mark_colorizedCopyWithColor:(UIColor *)color
blendMode:(CGBlendMode)blendMode;
UIImage *image = [UIImage imageNamed:@"image"];
UIImage *colorizedImage = [image mark_colorizedCopyWithColor:[UIColor greenColor]
blendMode:kCGBlendModeMultiply];
// ...
UIImage *colorizedImage2 = [UIImage mark_colorizeImage:image
withColor:[UIColor greenColor] blendMode:kCGBlendModeMultiply];
UIImage-MARKColorizer 可通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'UIImage-MARKColorizer'
Vadym Markov, [email protected]
UIImage-MARKColorizer 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。