another way to do it might be to use the
gimp and
perl-fu. Your program can call gimp commands programmatically
and ought to be able to fill a region if you can give it
a point inside each county. Though SVG or some postscript or pdf thing
might look prettier.
Just a wild guess but you might be able to even make a PDF
template of the map and then replace colors at appropriate
places in the program, if you are feeling adventurous.