Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

What is it? The ColorPickerFrame (ColorSelect) is the default WoW frame to easily select color and opacity using a GUI. The ColorPickerFrame comes with customizable functions, which are next.


ColorPickerFrame functions

ColorPickerFrame.func();
--Called on hitting OKAY button
ColorPickerFrame.opacityFunc();
--Called on changing the opacity slider
ColorPickerFrame.cancelFunc();
 --Called on hitting CANCEL button OR pressing ESCAPE

These functions can be specified by you to do something. The best example us making pressing the OKAY button set some variables to the selected color. Check the following code:


ColorPickerFrame.func = MY_COLOR_FUNCTION

function MY_COLOR_FUNCTION()
  local R,G,B = ColorPickerFrame:GetColorRGB();
end

All the functions can be set in that manner.

ColorPickerFrame Misc

ColorSwatch:SetTexture(R, G, B);
--Sets the color square to show specified color
ColorPickerFrame:Show();
--Shows the frame
ColorPickerFrame:Hide();
--Hides the frame
ColorPickerFrame:SetColorRGB(R, G, B);
--Set the color in the color frame
local R,G,B = ColorPickerFrame:GetColorRGB();
--Gets the color from the color frame


Examples of use

Open frame with specified values:

ColorPickerFrame:Show();
ColorPickerFrame:SetColorRGB(R, G, B);

Set R, G, and B to the ColorWheel's colors on OKAY

ColorPickerFrame.func = MY_COLOR_FUNCTION

function MY_COLOR_FUNCTION()
 local R,G,B = ColorPickerFrame:GetColorRGB();
end
Advertisement