johankasperi / SwiftHSVColorPicker

Simple HSV Color Picker for iOS written in Swift.
MIT License
94 stars 34 forks source link

Circle thumb's position is wrong. #20

Open JeromeTW opened 7 years ago

JeromeTW commented 7 years ago

At first, thank you for the nice color tool.

It's easy to reproduce the problem. I downloaded your example, and changed getSelectedColor(_ sender: UIButton) function as following.

@IBAction func getSelectedColor(_ sender: UIButton) {
        // Get the selected color from the Color Picker.
        let selectedColor = colorPicker.color
        colorPicker.setViewColor(selectedColor!)
        print(selectedColor!)
}

then, run example app on device. 1.move circle thumb to the top of the Big color circle. 2.pressed "select color", you will see the circle thumb position is moved down a little bit. 3.but if you select color is white at the Big color circle's center, will not see the phenomenon.

I guess it's about the color's format(RGB, HSV)

Xcode 8, Swift 3, iPad Mini, iOS 9.1

jmcazaux commented 7 years ago

I have witnessed the same kind of issues.

When choosing a colour towards the yellow quadrant, it gives strange results with a negative blue component which produces strange results.

It seems that there is an offset indeed. Not sure where it is coming from, but it would be great if it could be solved as the component is really great otherwise.