PDA

View Full Version : DUI Designer Color Picker



harleydude
January 31st, 2009, 06:19 PM
Is this a usable control for forms? I can add it to a form and select a color, however there appears to be no documentation on that control. Also need docs on the font picker.

Thanks

harleydude
January 31st, 2009, 09:00 PM
Figured it out. The Color Picker control has a field called Color. I assume is contains the 24 bit value of the color. I used the following code to convert it to RGB values.


function Convert24bitcolor (color)
color = color or 0
local red = math.mod(color,256)
local green = math.mod(math.band(color,65280) / 256, 256)
local blue = math.band(color,16711680) / 65536
return red, green, blue
end


Seems to work great.

harleydude
January 31st, 2009, 09:15 PM
Also the Fontpicker contains a table called Font it contains the following.


["Font"] = { -- #1
["Color"] = -16777208,
["StrikeOut"] = false,
["Italic"] = false,
["Name"] = "MS Sans Serif",
["Bold"] = false,
["Underline"] = false,
["Height"] = -11,
["Size"] = 8,
} -- #1,