Index: /CKEditor/trunk/_source/plugins/colorbutton/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/colorbutton/plugin.js	(revision 5347)
+++ /CKEditor/trunk/_source/plugins/colorbutton/plugin.js	(revision 5348)
@@ -87,11 +87,23 @@
 					panel.hide();
 
-					var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : color || 'inherit' } );
 
 					editor.fire( 'saveSnapshot' );
+
+					// Clean up any conflicting style within the range.
+					new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : 'inherit' } ).remove( editor.document );
+
 					if ( color )
-						style.apply( editor.document );
-					else
-						style.remove( editor.document );
+					{
+						var colorStyle = config['colorButton_' + type + 'Style'];
+
+						colorStyle.childRule = type == 'back' ?
+							// It's better to apply background color as the innermost style. (#3599)
+							function(){ return false; } :
+							// Fore color style must be applied inside links instead of around it.
+							function(){ return element.getName() != 'a'; };
+						
+						new CKEDITOR.style( colorStyle, { color : color } ).apply( editor.document );
+					}
+
 					editor.fire( 'saveSnapshot' );
 				});
@@ -215,11 +227,5 @@
 		element		: 'span',
 		styles		: { 'color' : '#(color)' },
-		overrides	: [ { element : 'font', attributes : { 'color' : null } } ],
-
-		// Fore color style must be applied inside links instead of around it.
-		childRule : function( element )
-		{
-			return element.getName() != 'a';
-		}
+		overrides	: [ { element : 'font', attributes : { 'color' : null } } ]
 	};
 
@@ -238,10 +244,4 @@
 	{
 		element		: 'span',
-		styles		: { 'background-color' : '#(color)' },
-
-		// It's better to apply background color as the innermost style. (#3599)
-		childRule : function( element )
-		{
-			return false;
-		}
+		styles		: { 'background-color' : '#(color)' }
 	};
