CColorRef:Choose


The Choose method opens the Windows ChooseColor common dialog to interactively change the components of a CColorRef. This method opens the dialog in minimized mode; to open in maximized mode, showing the palette, use ChoosePal instead.

Syntax

bSuccess = CColorRef:Choose()

where

    bSuccess is the returned success code. On success it is true, otherwise false.

  

This method returns true if the [OK] button was clicked on the Choose Color dialog. After clicking [OK], the CColorRef members are updated with the new color components.

Example

The following script interactively changes the properties of a CColorRef:

 

C = CColorRef:new()

-- create a new CColorRef

C:Set(255,255,0)

-- set bright yellow

if ( C:Choose() ) then

-- if OK button clicked, show results

  Printf("%d,%d,%d", C.R,C.G,C.B )

-- print new color

end

  

Related Topics

ChoosePal

CColorRef class