Skip to content
João Cardoso edited this page Dec 5, 2019 · 8 revisions

ColorPicker is a color selection button which inherits from the TextedClickable class.
💡 Image not up to date with the current design

Preview

Methods

Name Description
SetColor (color), SetValue (color) Sets the current value using a color mixin object.
GetColor, GetValue Returns the current value as a color mixin object.
HasAlpha Returns whether alpha is enabled.

Calls

Name Description
OnColor (color), OnInput (color) Fired when a new color or alpha is selected by the user.
OnUpdate Fired after the color selection dialog is closed.

Example

local picker = LibStub('Sushi-3.1').ColorPicker()
picker:SetLabel('Lipstick Color')
picker:SetValue(CreateColor(1,0,0))
picker:SetCall('OnColor', function(picker, color)
 if color.r > .8 then
  print("Too much red.")
 elseif color.g < .4 then
  print("Just a little greener, please?")
 else
  print("That is a beautiful color!")
 end
end)

Sushi-3.1 🍣

Documentation
Class Reference
Best Practices

Feedback
Post an issue

Clone this wiki locally