This is a public function designed to call the common dialog control color palette and select a color for use within a program.

Three color data return modes are possible using this utility function whereby the color information may be returned as a single composite color number in the range from 0 to 16,777,215 or as three decimal RGB values, each ranging from 0 to 255 or as three hexadecimal RGB values, each ranging from 00 to FF, whichever is more convenient.

Once this information is returned it is a simple matter to parse the result for specific use within a program.

The calling format is:

Q = Selected_Color("C|D|H")

Where:

C = Composite mode   - Returns a single decimal value from 0 to 16,777,215
D = Decimal mode     - Returns a string with the RGB components in decimal
H = Hexadecimal mode - Returns a string with the RGB components in hexadecimal

Within the function is documentation explaining how to extract the individual RGB color components from the single composite color number returned by the palette color selection.

