GRASS Programmer's Manual
6.4.2(2012)
|
00001 /* 00002 * Identify a color that has been set in the reset_color() (found in Reset_clr.c 00003 * file in this directory). Subsequent graphics calls will use this color. 00004 * 00005 * Called by: 00006 * Color() in ../lib/Color.c 00007 */ 00008 00009 #include <grass/gis.h> 00010 #include "pngdriver.h" 00011 00012 void PNG_color(int number) 00013 { 00014 if (number >= NCOLORS || number < 0) { 00015 G_warning("Color: can't set color %d\n", number); 00016 return; 00017 } 00018 00019 if (true_color) { 00020 int r = (number >> 16) & 0xFF; 00021 int g = (number >> 8) & 0xFF; 00022 int b = (number >> 0) & 0xFF; 00023 00024 currentColor = get_color(r, g, b, 0); 00025 } 00026 else 00027 currentColor = number; 00028 }