Notes
- The dialog box only uses the current Windows system theme
ui.colordialog([color])
Displays a dialog box for the user to choose a color.
Parameters
color
An optional number that indicates the current color in the dialog.
Return value
This function returns a number representing a RGB color (one byte per primary color), or nil if no color have been choosen.Example
local ui = require "ui"
-- open a dialog to choose a color
local color = ui.colordialog()
-- check if a color have been choosen
if color ~= nil then
-- output color value
local msg = "Color : 0x"..string.format("%06X", color).."\nRed : #"..string.format("%02X", (color>>16)&0x0FF).."\nGreen : #"..string.format("%02X", (color>>8)&0x0FF).."\nBlue : #"..string.format("%02X", color&0x0FF)
ui.info(msg)
end