GRASS Programmer's Manual
6.4.2(2012)
|
00001 00002 #include <grass/gis.h> 00003 #include "psdriver.h" 00004 00005 void PS_color(int number) 00006 { 00007 if (number >= NCOLORS || number < 0) { 00008 G_warning("Color: can't set color %d\n", number); 00009 return; 00010 } 00011 00012 if (true_color) { 00013 int r = (number >> 16) & 0xFF; 00014 int g = (number >> 8) & 0xFF; 00015 int b = (number >> 0) & 0xFF; 00016 00017 output("%d %d %d COLOR\n", r, g, b); 00018 } 00019 else 00020 output("%d GRAY\n", number); 00021 }