Adding color access to mapscript

Stephen Lime steve.lime at dnr.state.mn.us
Thu Feb 22 11:17:50 EST 2001


Ok, it's a kludge but should work. Untar the attached file someplace and move map.h
to the main source directory, mapscript.i to the mapscript directory and the other two
files to mapscript/perl. Then rebuild as normal. That should expose the palette to 
mapscript and add a method to get at colors. Usage is:

  $color = $map->getColor($i);
  print "Color is: ". $color->{red} ." ". $color->{green} ." ". $color->{blue} ."\n";
  print "Number of colors is: ". $map->{palette}->{numcolors} ."\n";

Note that the palette only contains colors as assigned to features. No raster color 
information is present.

Only use this code if you *really* need the functionallity.

Steve


Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937




More information about the mapserver-users mailing list