Creating a Color Picker

One of the more complex user-interface gadgets I've always admired is the color picker. Color pickers usually have several characteristics in common they display a range of colors from which the user can choose, they display the currently selected color, and they display the color that the mouse is currently over. Using the DOM, you can create a color picker that performs all of these tasks. Figure 9-1 shows a page that contains a dynamically generated color picker that allows a user to select...