|
red (optional) - initial red component, 0 to 255; 255 (default) green (optional) - initial green component, 0 to 255; 255 (default) blue (optional) - initial blue component, 0 to 255; 255 (default) |
|
Opens the colour picker and waits; returns 1 if the user chose a colour, 0 on cancel. The chosen colour is not returned directly - read it with RequestedRed, RequestedGreen and RequestedBlue after the call returns 1. On cancel those values keep whatever they held before, so always check the result first: If RequestColor(200,80,80) SetPanelColor swatch,RequestedRed(),RequestedGreen(),RequestedBlue() EndIf The red, green and blue parameters preselect a starting colour (out-of-range values are clamped) - pass the colour currently in use so the user can tweak rather than rebuild it. On Windows the picker is drawn in the GUI theme: a colour square and a hue slider beside the new and current colours, Hex, Red, Green and Blue fields, a row of basic colours, and a row of the colours chosen recently while the program has been running. Clicking Current goes back to the starting colour, and double-clicking a swatch chooses it. On macOS it is the system colour panel, and on the web the browser's colour picker. Like the other requesters it is modal, owned by your active GUI window, and posts begin/end-modal events ($2004/$2005) to the shared event queue. Your program waits until the user closes it, so nothing on screen changes meanwhile. To show the colour in your scene as the user drags, open the picker with OpenColorPicker instead. See also: OpenColorPicker, RequestedRed, RequestedGreen, RequestedBlue, RequestFont, SetPanelColor. |