Using the color picker

fontcolorpickers.C summarizes how to use a x::w::color_picker display element. This display element provides a popup for selecting the red, green, and blue channels of a x::w::rgb. The popup ignores the alpha channel component.

x::w::color_picker's overloaded current_color() method returns the most recently-selected x::w::rgb color, or resets the popup with the specified color. on_color_update() installs a callback that gets invoked whenever a new color gets officially picked, by the popup's Ok button. Only one callback can be installed at one time, and the initial callback is one of the values that are specified in x::w::color_picker_config when creating the color picker.