|
@@ -21,7 +21,15 @@ extension UIImage {
|
|
|
|
|
|
let colorSpace = CGColorSpaceCreateDeviceRGB()
|
|
|
let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedLast.rawValue)
|
|
|
- let context = CGContext(data: nil, width: Int(width), height: Int(height), bitsPerComponent: 8, bytesPerRow: 0, space: colorSpace, bitmapInfo: bitmapInfo.rawValue)!
|
|
|
+ let context = CGContext(
|
|
|
+ data: nil,
|
|
|
+ width: Int(width),
|
|
|
+ height: Int(height),
|
|
|
+ bitsPerComponent: 8,
|
|
|
+ bytesPerRow: 0,
|
|
|
+ space: colorSpace,
|
|
|
+ bitmapInfo: bitmapInfo.rawValue
|
|
|
+ )!
|
|
|
|
|
|
context.clip(to: bounds, mask: maskImage)
|
|
|
context.setFillColor(color.cgColor)
|