Skip to content

Commit

Permalink
made conversions actually public
Browse files Browse the repository at this point in the history
(whoops)
  • Loading branch information
juliand665 committed Feb 20, 2018
1 parent d7a019e commit ad3b9bf
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 @@ -17,7 +17,7 @@ extension Pixel {

There is some loss of information, e.g. a fully transparent red pixel loses information about its color due to alpha premultiplication. For fully transparent pixels, this method returns a fully transparent black color (`r=g=b=a=0`).
*/
var nsColor: NSColor {
public var nsColor: NSColor {
guard self.alpha > 0 else { return #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0) }
let alpha = CGFloat(self.alpha) // stupid premultiplication
let color = NSColor(red: CGFloat(red) / alpha,
Expand Down
2 changes: 1 addition & 1 deletion Bitmap/UIKit/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extension Pixel {

There is some loss of information, e.g. a fully transparent red pixel loses information about its color due to alpha premultiplication. For fully transparent pixels, this method returns a fully transparent black color (`r=g=b=a=0`).
*/
var uiColor: UIColor {
public var uiColor: UIColor {
guard self.alpha > 0 else { return #colorLiteral(red: 0, green: 0, blue: 0, alpha: 0) }
let alpha = CGFloat(self.alpha) // stupid premultiplication
let color = UIColor(red: CGFloat(red) / alpha,
Expand Down

0 comments on commit ad3b9bf

Please sign in to comment.