I want to setup a custom color picker. I have setup a circular image with a picker bug. But, I want the bug to only move over the image (there are no colours outside the image), or, another way, only in the circle of the image size.
How can I limit the bug position?
I understand that you want to keep your picker inside the circle image. To do that just simply grab center point (p1) of your circle image and center point (p2) of currnet position of the picker. Calculate distans between both:
And if the distance is more that circle radius stop move your picker:
Hope this is what you are about.