zakkhoyt / ColorPicKit

A collection of UIControls for picking colors on iPhone, iPad, and other iOS devices. Gradient slider, Hue slider, RGB sliders, HSB sliders, CMYK sliders, ImagePixelPicker, HSB Wheel, HSB Spectrum. Color related class extensions
MIT License
15 stars 4 forks source link

Instead of returning optionals, throw errors #8

Open zakkhoyt opened 7 years ago

zakkhoyt commented 7 years ago

Update these methods to throw instead of returning optionals

// Class function
public class func pixelBufferOf(image: UIImage) -> CVPixelBuffer?
public class func pixelBufferPropertiesOf(image: UIImage) -> (pixelBuffer: CVPixelBuffer?, size:CGSize, bytesPerRow: Int)
public class func pixelColorOf(image: UIImage, at point: CGPoint) -> UIColor?

// Instance methods

public func pixelColorAt(point: CGPoint) -> UIColor? {
public func pixelBufferProperties() -> (pixelBuffer: CVPixelBuffer?, size:CGSize, bytesPerRow: Int)
zakkhoyt commented 7 years ago

Add an Error factory as well.