Colorchooser widget == Description == The markup ++++ implements //color selectors// which allows users to select graphically colors. == Synopsis == === Server & client === ( arg ...) === client === (hop-colorchooser-value cc val) (hop-colorchooser-value-set! cc val) (hop-colorchooser-opacity cc val) (hop-colorchooser-opacity-set! cc val) === Requirements === Client codes using //color choosers// need to load the following client-side library ++hop-color++. ( :include "hop-color") == Examples == == Server & Client Definitions == === ++++ === ^ attributes ^ type ^ default ^ short description ^ | :id | string | //random// | element identifier. | | :onchange | procedure | _ | a procedure to invoke on value changes. | | :onselect | procedure | _ | a procedure to invoke on //ok// clicks. | | :oncancel | procedure | _ | a procedure to invoke on //cancel// clicks. | | body | xml | _ | the body of the color chooser. | This function creates a //color chooser//. ~~ The argument :onchange is a script that is invoked each time the colorchooser is changed via the GUI. That is calling the function ++colorchooser-value-set!++ **does not** invoke automatically :onchange. In the scope of that script, the variable ++this++ is bound to the //colorchooser// whose value can be retrieve by the means of the function ++colorchooser-value++. The opacity can be retrieved and set with ++colorchooser-opacity++ and ++colorchooser-opacity-set!++. ~~ If no body is provided one "cancel" and one "ok" buttons are automatically inserted. == Client Definitions == === ++(colorchooser-value cc)++ === === ++(colorchooser-value-set! cc val)++ === colorchooser-value colorchooser-value-set! ^ arguments ^ type ^ short description ^ | colorchooser | colorchooser or string | the cc button. | | val | string | the new colorchooser value. | These functions get and set the value of a //color chooser//. Example: (let ((but ( :max 10 :min -10 :onchange ~(alert (colorchooser-value this))))) (