Restrict Movement in a shape?

I am making a game in which there are some berries in a tray that is star shaped. The berries are already in the tray. The user can drag them. The problem is they go out of tray. I don’t know how to restrict them in that star. I do know to restrict them in that image bounds. Any Help?

I just found collider.bounds function. Its great. Now im kinda on my track. Its not working perfectly to some shapes but i think i’ll figure it out.