prova cosi
Codice PHP:

// colore sfondo 

if($dati >10 && $dati<15 ){
$r255
$g200
$b0
// colore testo 
$r1255
$g2255 
$b3
255
}
if(
$dati >15 && $dati<20 ){
$r200
$g200
$b100
// colore testo 
$r1255
$g2255 
$b3
255
}



// crea immagine 50*15  
$im imagecreate(5015); 
// sfondo all' immagine  
$background imagecolorallocate($im$r$g$b); 
// testo color bianco 
$textcolor imagecolorallocate($im$r1$g2$b3); 
// valore testo 
$txt = ("$dati1[2]");