Harinath Kolli Harinath Kolli - 20 days ago 5
Javascript Question

How to change the background color of container in CKEditor with color palette

How to change the color of the container with inline ckeditor from the list of colors.I know we have "colorbutton" plugin to change the text color and background color of block element but I need to change the entire container color.
Here is the image about my requirement

Answer

Modified the colorbutton button ckeditor plugin. Add the following conditions in renderColors() method.

if(type != 'back'){
 editor.applyStyle( new CKEDITOR.style( colorStyle, { color: color } ) );   
}else{
  editor.container.$.style.backgroundColor=color;
}
Comments