Index: /CKEditor/branches/versions/3.5.x/CHANGES.html
===================================================================
--- /CKEditor/branches/versions/3.5.x/CHANGES.html	(revision 5934)
+++ /CKEditor/branches/versions/3.5.x/CHANGES.html	(revision 5935)
@@ -42,4 +42,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/5755">#5755</a> : Introduced the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.dialog_buttonsOrder">dialog_buttonsOrder</a> setting, making it possible to control the buttons order.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/4648">#4648</a> : Added the new Iframe plugin.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6010">#6010</a> : The "automatic" option of the font/background color panel now represents the real color.</li>
 	</ul>
 	<p>
Index: /CKEditor/branches/versions/3.5.x/_source/plugins/colorbutton/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.5.x/_source/plugins/colorbutton/plugin.js	(revision 5934)
+++ /CKEditor/branches/versions/3.5.x/_source/plugins/colorbutton/plugin.js	(revision 5935)
@@ -23,4 +23,5 @@
 		function addButton( name, type, title )
 		{
+			var colorBoxId = CKEDITOR.tools.getNextId() + '_colorBox';
 			editor.ui.add( name, CKEDITOR.UI_PANELBUTTON,
 				{
@@ -40,5 +41,5 @@
 						block.autoSize = true;
 						block.element.addClass( 'cke_colorblock' );
-						block.element.setHtml( renderColors( panel, type ) );
+						block.element.setHtml( renderColors( panel, type, colorBoxId ) );
 						// The block should not have scrollbars (#5933, #6056)
 						block.element.getDocument().getBody().setStyle( 'overflow', 'hidden' );
@@ -53,4 +54,29 @@
 						keys[ CKEDITOR.SHIFT + 9 ]	= 'prev';	// SHIFT + TAB
 						keys[ 32 ]	= 'click';					// SPACE
+					},
+
+					// The automatic colorbox should represent the real color (#6010)
+					onOpen : function()
+					{
+						var selection = editor.getSelection(),
+							block = selection && selection.getStartElement(),
+							path = new CKEDITOR.dom.elementPath( block ),
+							color;
+
+						// Find the closest block element.
+						block = path.block || path.blockLimit;
+
+						// The background color might be transparent. In that case, look up the color in the DOM tree.
+						do
+						{
+							color = block && block.getComputedStyle( type == 'back' ? 'background-color' : 'color' ) || 'transparent';
+						}
+						while ( type == 'back' && color == 'transparent' && ( block = block.getParent() ) );
+
+						// The box should never be transparent.
+						if ( !color || color == 'transparent' )
+							color = '#ffffff';
+
+						this._.panel._.iframe.getFrameDocument().getById( colorBoxId ).setStyle( 'background-color', color );
 					}
 				});
@@ -58,5 +84,5 @@
 
 
-		function renderColors( panel, type )
+		function renderColors( panel, type, colorBoxId )
 		{
 			var output = [],
@@ -122,5 +148,5 @@
 						'<tr>' +
 							'<td>' +
-								'<span class="cke_colorbox" style="background-color:#000"></span>' +
+								'<span class="cke_colorbox" id="', colorBoxId, '"></span>' +
 							'</td>' +
 							'<td colspan=7 align=center>',
