skydoves / ColorPickerView

🎨 Android colorpicker for getting colors from any images by tapping on the desired color.
Apache License 2.0
1.57k stars 211 forks source link

getSelectedPoint and setSelectorPoint bug #88

Open bytealan opened 2 years ago

bytealan commented 2 years ago

There is an error between the obtained coordinates and the set coordinates

getSelectedPoint -> Point(620, 435) setSelectorPoint -> Point(620, 435) approximatedPoint -> Point(618, 434)

skydoves commented 2 years ago

Hi @WuWenL0, could you elaborate on this?

The approximatedPoint don't calculate exactly the same point which is selected by users and the method does approximate as the method name is.

One of the reasons is - If a user touches outside of the image matrix, we should calculate the nearest and proper colors from the point. So 1~2 points difference might happen in the calculating. If you could suggest or find any great algorithm/solution, it would be very appreciated!

Thanks.

bytealan commented 2 years ago

Thank you for answering the question. See the video below for my problems. There are five alphatileviews. When I click, I will switch and save the point of the previous alphatileview, and switch to the new alphatileview point. When I click repeatedly, the color will change. Is there any good way to solve it?

https://user-images.githubusercontent.com/53036149/164951372-4db403b9-61bc-42a5-bd1e-fe952f04a34c.mp4

Deaful commented 1 year ago

@skydoves Hi,could you set a switch to control whether point need to calculate exactly or not?And this switch has getter and setter method.