Index: _source/plugins/colorbutton/plugin.js
===================================================================
--- _source/plugins/colorbutton/plugin.js	(revision 5265)
+++ _source/plugins/colorbutton/plugin.js	Wed Apr 07 15:54:25 CST 2010
@@ -86,13 +86,25 @@
 
 					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' );
 				});
 
@@ -214,13 +226,7 @@
 	{
 		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 } } ]
 	};
 
 /**
@@ -237,11 +243,5 @@
 CKEDITOR.config.colorButton_backStyle =
 	{
 		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)' }
 	};
