Skip to content

RequestColor

Narta Xaymar Dirks edited this page Nov 25, 2026 · 9 revisions

RequestColor BlitzPlus

RequestColor:Int32 red:Int32=255, green:Int32=255, blue:Int32=255
Parameter Mode Type Default Description
red In Int32 255 Red the sliders start at, 0 to 255. Defaults to 255.
green In Int32 255 Green the sliders start at, 0 to 255. Defaults to 255.
blue In Int32 255 Blue the sliders start at, 0 to 255. Defaults to 255.

Returns: 1 if the user pressed OK, 0 if the dialog was cancelled.

Description

Opens a color picker with three sliders and waits until the user presses OK or Cancel. Read the picked color with RequestedRed, RequestedGreen and RequestedBlue. While the picker is open nothing else in the program window reacts.

Differences

  • The picker is drawn by the runtime inside the program's active window (in a window of its own where there is none) and is simpler than the Windows color dialog: three sliders and a preview, no palette and no custom colors. Return confirms and Escape cancels; the mouse counts in that window only.

Examples

Graphics 480, 300, 32, 2
win   = CreateWindow("Pick", 20, 20, 240, 140, Desktop(), 3)
swatch = CreatePanel(20, 20, 100, 60, win)
If RequestColor(40, 120, 200) Then
	SetPanelColor swatch, RequestedRed(), RequestedGreen(), RequestedBlue()
EndIf
Repeat
Until WaitEvent() = $803

Media

RequestColor

Related Commands

RequestDir BlitzPlus, RequestedBlue BlitzPlus, RequestFile BlitzPlus, RequestFont BlitzPlus

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally