-
-
Notifications
You must be signed in to change notification settings - Fork 8
ColorPicker
Jaliborc edited this page Jul 13, 2012
·
8 revisions
ColorPicker is a button class which inherits from CheckButton and exposes an interface for selecting color and alpha values.
Name | Description |
---|---|
SetColor (r,g,b,[a]) | Sets the selected color in the picker using RGB code. If alpha is enabled, a RGBA code should be provided instead. All values ranges from 0 to 1 |
GetColor () | Returns the selected color and alpha in the picker as explained in "SetColor". |
EnableAlpha (enable) | If true, the picker will allow the user to select an extra alpha value, in addition to the color. Disabled by default. |
HasAlpha () | Returns true if alpha is enabled. |
SetValue (r,g,b,[a]) | Alias for "SetColor". |
GetValue () | Alias for "GetColor". |
Name | Description |
---|---|
OnColorChanged (r,g,b,[a]), OnInput (r,g,b,[a]) | Fired when a new color or alpha is selected by the user. Passes the same values as explained in "SetColor". |
OnUpdate | Fired when a new color or alpha is selected by the user, after the other calls have been made. |
myPicker = SushiColorPicker()
myPicker:SetLabel('Lipstick Color')
myPicker:EnableAlpha(false)
myPicker:SetCall('OnColorChanged', function(myPicker, r,g,b)
if r > .8 then
print("Too much red.")
elseif g < .4 then
print("Just a little greener, please?")
else
print("That is a beautiful color!")
end
end)
This is the Sushi-3.1 wiki. Wiki Home