There are already classes added if the question has 0 answers, or if it has a best answer selected. So you can just use this:
.qa-a-count.qa-a-count-zero {
color: #a33;
}
.qa-a-count.qa-a-count-selected {
color: #3a3;
}
UPDATE: sorry I forgot that I added the 'zero' class myself! The 'selected' class is definitely there, here is what the function is by default:
function a_count($post)
{
// You can also use $post['answers_raw'] to get a raw integer count of answers
$this->output_split(@$post['answers'], 'qa-a-count', 'SPAN', 'SPAN',
@$post['answer_selected'] ? 'qa-a-count-selected' : null);
}
Here is what I changed the function to:
function a_count($post)
{
$extraclass = null;
if ( @$post['answers_raw'] == 0 )
$extraclass = 'qa-a-count-zero';
if ( @$post['answer_selected'] )
$extraclass = 'qa-a-count-selected';
$this->output_split(@$post['answers'], 'qa-a-count', 'SPAN', 'SPAN', $extraclass);
}
Now you can set the default colour on the qa-a-count class, then use the CSS above to override that if there are 0 answers, or an answer was selected.
If you need to style specific answers counts like 1, 2, 3 then you could do this and style appropriately:
if ( @$post['answers_raw'] > 0 )
$extraclass = 'qa-a-count-'.$post['answers_raw'];