LM.GUI.ColorSwatch(allowAlpha, msg)

Version added: before 9.5

Creates a new LM_ColorSwatch object

ArgumentTypeDescriptionDefaultVer
allowAlphaboolTrue if the user should be allowed to specify alpha (opacity), false otherwise< 9.5
msgint32A message value to be triggered when a new color is chosen0< 9.5

Return type (LM_ColorSwatch): The newly created color swatch object

function MyDialog:new(moho)
local d = LM.GUI.SimpleDialog("Color Swatch Dialog", MyDialog)
local l = d:GetLayout()

-- create a new LM_ColorSwatch object:
d.MyColorSwatch = LM.GUI.ColorSwatch(true)
l:AddChild(d.MyColorSwatch)

return d
end

function MyScript:Run(moho)
-- initiate the dialog:
local dlog = MyDialog:new(moho)
if (dlog:DoModal() == LM.GUI.MSG_CANCEL) then
return
end
end

Image

Color Swatch Dialog



See also: LM_ColorSwatch:SetValue, LM_ColorSwatch:Value, LM.GUI.ShortColorSwatch