Full code:Full code and working for anyone who may be interested in it
<div class="color">
<?php if($_product->isConfigurable()): ?>
<?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributes($_product) ?>
<?php if(count($attributes)): ?>
<div>
<?php foreach($attributes as $att): ?>
<?php $pAtt=$att->getProductAttribute();
if ($pAtt->getFrontendLabel() != 'Color') continue;
//get the child products
$allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);
$frontValues =array(); ?>
<div style="text-align:center;"><!--<?php $colorValuesecho =array$pAtt->getFrontendLabel() ?>-->
<div style="text-align:center;"><!--<ul>
<?php echo
$pAtt->getFrontendLabel() ?>-->
<ul> $output = array();
<?php foreach($allProducts as $p): ?>{
<?php if(!$p->isSaleable()) continue; ?>
<?php $out=$p $output[$p->getAttributeText($pAtt->getName());] ?>= array(
<?php $frontValues[$out]=$out; ?> 'out' => $p->getAttributeText($pAtt->getName()),
<?php $colors=$p 'color' => $p->getData(strtolower($pAtt->getName()));
?> );
<?php $colorValues[$colors]=$colors;}
?>
<?php endforeachforeach($output as $key => $value) : ?>
<li><a id="a-<?php echo $out$value['color'] ?>"><?php echo implode('</li><li">', $frontValues);$value['out'] ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
<?php endif ?>
</div>