# tinymce.ui.ColorSplitButton

Namespace | tinymce.ui
Class | ColorSplitButton
Inheritance | ColorSplitButton SplitButton Button Control

This class is used to create UI color split button. A color split button will present show a small color picker when you press the open menu.

## Public Properties

Property | Defined By
--- | ---
settings : Object Settings object. | ColorSplitButton
value : String Current color value. | ColorSplitButton

## Public Methods

Method | Defined By
--- | ---
ColorSplitButton(id:String, s:Object, ed:Editor) Constructs a new color split button control instance. | ColorSplitButton
destroy():void Destroys the control. | ColorSplitButton
displayColor(c:String):void Change the currently selected color for the control. | ColorSplitButton
hideMenu(e:Event):void Hides the color menu. | ColorSplitButton
isActive():Boolean Returns true/false if the control is disabled or not. | Control
isDisabled():Boolean Returns true/false if the control is disabled or not. | Control
isRendered():Boolean Returns true/false if the control has been rendered or not. | Control
postRender():void Post render event. | ColorSplitButton
remove():void Removes the control. | Control
renderHTML():String Renders the split button as a HTML string. | SplitButton
renderMenu():void Renders the menu to the DOM. | ColorSplitButton
renderTo(n:Element):void Renders the control to the specified container element. | Control
setActive(s:Boolean):void Sets the activated state for the control. | Control
setColor(c:String):void Sets the current color for the control and hides the menu if it should be visible. | ColorSplitButton
setDisabled(s:Boolean):void Sets the disabled state for the control. | Control
setState(c:String, s:Boolean):void Sets the specified class state for the control. | Control
showMenu():void Shows the color menu. | ColorSplitButton

## Public Events

Event | Defined By
--- | ---
onHideMenu() Fires when the menu is hidden. | ColorSplitButton
onShowMenu() Fires when the menu is shown. | ColorSplitButton

## Property details

### settingsproperty

`public settings : Object`
Settings object.

### valueproperty

`public value : String`
Current color value.

## Method details

### ColorSplitButtonconstructor

`public function ColorSplitButton(id:String, s:Object, ed:Editor)`
Constructs a new color split button control instance.

#### Parameters

id:String | Control id for the color split button.
s:Object | Optional name/value settings object.
ed:Editor | The editor instance this button is for.

### destroymethod

`public function destroy():void`
Destroys the control. This means it will be removed from the DOM and any events tied to it will also be removed.

### displayColormethod

`public function displayColor(c:String):void`
Change the currently selected color for the control.

#### Parameters

c:String | Color code value in hex for example: #FF00FF

### hideMenumethod

`public function hideMenu(e:Event):void`
Hides the color menu. The optional event parameter is used to check where the event occured so it doesn't close them menu if it was a event inside the menu.

#### Parameters

e:Event | Optional event object.

### postRendermethod

`public function postRender():void`
Post render event. This will be executed after the control has been rendered and can be used to set states, add events to the control etc. It's recommended for subclasses of the control to call this method by using this.parent().

### renderMenumethod

`public function renderMenu():void`
Renders the menu to the DOM.

### setColormethod

`public function setColor(c:String):void`
Sets the current color for the control and hides the menu if it should be visible.

#### Parameters

c:String | Color code value in hex for example: #FF00FF

### showMenumethod

`public function showMenu():void`
Shows the color menu. The color menu is a layer places under the button and displays a table of colors for the user to pick from.

## Event details

### onHideMenuevent

`public event onHideMenu()`
Fires when the menu is hidden.

### onShowMenuevent

`public event onShowMenu()`
Fires when the menu is shown.