ColorSelect is a very specialized type of frame with a specific purpose; to allow the user to interactively select a color, typically to control the appearance of another UI element. Primarily used to allow the player to control the appearance of chat messages in different channels, they are also used when creating a tabard to control the color scheme.
While the ColorSelect type gives you fairly detailed control over the appearance of the color wheel and value slider, the standard Color picker frame as defined in FrameXML/ColorPickerFrame.xml is preconfigured and usually adequate to your needs. You will usually be most interested in the SetColor methods (to load a color you have stored for a particular element) and the GetColor methods (to retrieve the new color chosen by the user). ColorSelect supports both RGB and HSV color descriptions.
Defined Methods
- hue, saturation, value = ColorSelect:GetColorHSV() - Returns the hue, saturation and value of the currently selected color
- red, blue, green = ColorSelect:GetColorRGB() - Returns the red, green and blue components of the currently selected color
- texture = ColorSelect:GetColorValueTexture() - Returns the texture for the color picker's value slider background
- texture = ColorSelect:GetColorValueThumbTexture() - Returns the texture for the color picker's value slider thumb
- texture = ColorSelect:GetColorWheelTexture() - Returns the texture for the color picker's hue/saturation wheel
- texture = ColorSelect:GetColorWheelThumbTexture() - Returns the texture for the selection indicator on the color picker's hue/saturation wheel
- ColorSelect:SetColorHSV(hue, saturation, value) - Sets the color picker's selected color by hue, saturation and value
- ColorSelect:SetColorRGB(red, blue, green) - Sets the color picker's selected color by red, green and blue components
- ColorSelect:SetColorValueTexture(texture) - Sets the `Texture` object used to display the color picker's value slider
- ColorSelect:SetColorValueThumbTexture(texture) or ColorSelect:SetColorValueThumbTexture("filename") - Sets the texture for the color picker's value slider thumb
- ColorSelect:SetColorWheelTexture(texture) - Sets the `Texture` object used to display the color picker's hue/saturation wheel
- ColorSelect:SetColorWheelThumbTexture(texture) or ColorSelect:SetColorWheelThumbTexture("filename") - Sets the texture for the selection indicator on the color picker's hue/saturation wheel
Inherited Methods
- ColorSelect:GetPropagateKeyboardInput() - This function is not yet documented
- ColorSelect:IsForbidden() - This function is not yet documented
- ColorSelect:RegisterUnitEvent() - This function is not yet documented
- ColorSelect:SetDontSavePosition() - This function is not yet documented
- ColorSelect:SetPropagateKeyboardInput() - This function is not yet documented
- ColorSelect:SetShown() - This function is not yet documented
- ColorSelect:SetSize(width, height) - Sets the size of the region to the specified values
- ColorSelect:SetToplevel(enable) - Sets whether the frame should automatically come to the front when clicked
- ColorSelect:SetUserPlaced(enable) - Flags the frame for automatic saving and restoration of position and dimensions
- ColorSelect:SetWidth(width) - Sets the region's width
- ColorSelect:Show() - Shows the region
- ColorSelect:StartMoving() - Begins repositioning the frame via mouse movement
- ColorSelect:StartSizing() - Begins resizing the frame via mouse movement
- ColorSelect:StopAnimating() - Stops any active animations involving the region or its children
- ColorSelect:StopMovingOrSizing() - Ends movement or resizing of the frame initiated with [[docs/widgets/Frame/StartMoving|`:StartMoving()`]] or [[docs/widgets/Frame/StartSizing|`:StartSizing()`]]
- ColorSelect:UnregisterAllEvents() - Unregisters the frame from any [[docs/events|events]] for which it is registered
- ColorSelect:UnregisterEvent("event") - Unregisters the frame for an event
Script Handlers
- OnAttributeChanged(self, "name", value) - Run when a frame attribute is changed
- OnChar(self, "text") - Run for each text character typed in the frame
- OnColorSelect(self, r, g, b) - Run when the color select frame's color selection changes
- OnDisable(self) - Run when the frame is disabled
- OnDragStart(self, "button") - Run when the mouse is dragged starting in the frame
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame
- OnEnable(self) - Run when the frame is enabled
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnHide(self) - Run when the frame's visbility changes to hidden
- OnKeyDown(self, "key") - Run when a keyboard key is pressed if the frame is keyboard enabled
- OnKeyUp(self, "key") - Run when a keyboard key is released if the frame is keyboard enabled
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area
- OnLoad(self) - Run when the frame is created
- OnMouseDown(self, "button") - Run when a mouse button is pressed while the cursor is over the frame
- OnMouseUp(self, "button") - Run when the mouse button is released following a mouse down action in the frame
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame
- OnShow(self) - Run when the frame becomes visible
- OnSizeChanged(self, width, height) - Run when a frame's size changes
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine