you can use \033[ <colour_number> m without the spaces eg:
echo -e "\033[42mThis is green\033[0m"
I knocked up a bit of perl to illustrate:
#!/usr/bin/perl
for (30..37,40..47) {
print "\n" if ($_%10==0);
print "\033[$_" . "m $_ \033[0m";
}
print "\n";
--
Don't Stand on your head - you'll get footprints in your hair.
http://charlieharvey.com