Simply call ColourDBox_Open giving a palette entry (&BBGGRR00) of the initial colour, and a function to call with the final palette entry when the user clicks OK. The window is opened as a transient dialogue box.
Code lifted from !Phileas, you may distribute it provided all Copyright notices stay intact.