A comparison of Listing 2 and Figure 5 shows how the color chooser is integrated into the program.
Perhaps most important are the third parameter and the return value.