View Single Post
04/01/14, 08:42 AM   #6
Tingle0x539
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 25
Sorry I didn't reply, this is the proper usage:
Lua Code:
  1. colorWheel = WINDOW_MANAGER:CreateControl("MyColorWheel", parent, CT_COLORSELECT)
  2. colorWheel:SetAnchor(BOTTOMLEFT, parent, BOTTOMLEFT, -64, 64)
  3. colorWheel:SetDrawLayer(0)
  4. colorWheel:SetDimensions(64, 64)
  5. colorWheel:SetMouseEnabled(true) // This is what was missing, enabling this allows the color selection wheel to accept mouse input for its needed internal functions
  6. colorWheel:SetHidden(false)

Now after clicking, one can retrieve the color with
Lua Code:
  1. local red, green, blue = colorWheel:GetColorAsRGB();

Which are floats ranging from 0.0 also to 1.0 (0-255/0x00-0xFF)

I have not yet gotten the WheelThumb to work, but it is not needed. Clicking plainly on the wheel sets internal variables to the corresponding color one has clicked on.

Last edited by Tingle0x539 : 04/01/14 at 09:42 AM.
  Reply With Quote