diff --git a/Bitmap/AppKit/Helpers.swift b/Bitmap/AppKit/Helpers.swift index 92e5f8c..206efbf 100644 --- a/Bitmap/AppKit/Helpers.swift +++ b/Bitmap/AppKit/Helpers.swift @@ -12,7 +12,7 @@ extension Pixel { self.init(red: nsColor.redComponent, green: nsColor.greenComponent, blue: nsColor.blueComponent, - alpha: nsColor.alphaComponent) + premultiplyingWithAlpha: nsColor.alphaComponent) } public init(_ cgColor: CGColor) { diff --git a/Bitmap/UIKit/Helpers.swift b/Bitmap/UIKit/Helpers.swift index ff70a0b..68590eb 100644 --- a/Bitmap/UIKit/Helpers.swift +++ b/Bitmap/UIKit/Helpers.swift @@ -11,7 +11,7 @@ extension Pixel { public init(_ uiColor: UIColor) { var (r, g, b, a): (CGFloat, CGFloat, CGFloat, CGFloat) = (0, 0, 0, 0) uiColor.getRed(&r, green: &g, blue: &b, alpha: &a) - self.init(red: r, green: g, blue: b, alpha: a) + self.init(red: r, green: g, blue: b, premultiplyingWithAlpha: a) } public init(_ cgColor: CGColor) {