How to click only on the colored part of the image but not on the white background

Viewed 44

I am trying to render an image in react native. I want to select any part of that image. By selecting I mean I am now rendering a circle every time I press on the image.

You can find the codes here

The image now looks like this.

screenshot of the image

If the image doesn't load, then a backup image

This is fine. It works exactly I expect it to. But I can also select in the white background which is something I want to avoid. I want to only enable the clicking when clicked inside the t-shirt colors not on the white background. Now, how can I prevent the users from clicking on the white background instead of the image?

I know why this is happening, I also tried to implement this using svg image (You can find it in the repo, check out the SafeAreaRegion.tsx file).

How can I implement this?

0 Answers
Related