Difference between revisions of "Lua:createColorDialog"

From Cheat Engine
Jump to navigation Jump to search
(Initial page creation.)
 
m (Syntax Highlighting.)
 
Line 21: Line 21:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local dialog = createColorDialog()
 
local dialog = createColorDialog()
 
if dialog.execute() then
 
if dialog.execute() then
 
   print(string.format("Selected color: %X", dialog.Color))
 
   print(string.format("Selected color: %X", dialog.Color))
 
end
 
end
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Latest revision as of 19:39, 25 June 2026

<> Reference

function createColorDialog(owner OPTIONAL) : ColorDialog

Creates a ColorDialog.

Call execute() to show the dialog, then read Color when the user confirms the selection.

Function Parameters[edit]

Parameter Type Description
owner Component or nil Optional owner of the dialog.

Returns[edit]

ColorDialog — The created color dialog.

Examples[edit]

1 local dialog = createColorDialog()
2 if dialog.execute() then
3   print(string.format("Selected color: %X", dialog.Color))
4 end

See Also[edit]

Main Pages