Generate Random Hex Color code

Hello, I am working on creating a color picker type app. One of the functionality of the app is to show the color pallet.

For this I need some code assistance that can help me generate hex color codes randomly, which can be used with the color pallet.

No idea where to start with, pls help !