Skip to content

Commit

Permalink
Fixed alpha premultiplying issue
Browse files Browse the repository at this point in the history
  • Loading branch information
juliand665 committed Feb 17, 2018
1 parent f40bbdb commit a972756
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bitmap/AppKit/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Bitmap/UIKit/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a972756

Please sign in to comment.