1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
/*
* Identify a color that has been set in the reset_color() (found in Reset_clr.c
* file in this directory). Subsequent graphics calls will use this color.
*
* Called by:
* Color() in ../lib/Color.c
*/
#include <grass/gis.h>
#include "pngdriver.h"
void PNG_color(int number)
{
if (number >= NCOLORS || number < 0) {
G_warning("Color: can't set color %d\n", number);
return;
}
if (true_color) {
int r = (number >> 16) & 0xFF;
int g = (number >> 8) & 0xFF;
int b = (number >> 0) & 0xFF;
currentColor = get_color(r, g, b, 0);
}
else
currentColor = number;
}
|