Not sure if I understand your issue correctly but try
$ct = 0;
foreach($allProducts as $p){
if(!$p->isSaleable()) continue;
$out = $p->getAttributeText($pAtt->getName());
$frontValues[$ct]=$out;$frontValues[$out]=$out;
$colors=$p->getData(strtolower($pAtt->getName()));
$colorValues[$ct]=$colors;
$colorValues[$out]=$colors; $ct++;
}
<?php foreach($frontValues as $key => $value) : ?>
<li><a id="a-<?php echo $colorValues[$key] ?>"><?php echo $value ?></li>
<?php endforeach; ?>
or
$output = array();
foreach($allProducts as $p){
if(!$p->isSaleable()) continue;
$output[]$output[$p->getAttributeText($pAtt->getName())] = array(
'out' => $p->getAttributeText($pAtt->getName()),
'color' => $p->getData(strtolower($pAtt->getName()))
);
}
<?php foreach($output as $key => $value) : ?>
<li><a id="a-<?php echo $value['color'] ?>"><?php echo $value['out'] ?></li>
<?php endforeach; ?>