GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
psdriver/Color.c
Go to the documentation of this file.
1 
2 #include <grass/gis.h>
3 #include "psdriver.h"
4 
5 void PS_color(int number)
6 {
7  if (number >= NCOLORS || number < 0) {
8  G_warning("Color: can't set color %d\n", number);
9  return;
10  }
11 
12  if (true_color) {
13  int r = (number >> 16) & 0xFF;
14  int g = (number >> 8) & 0xFF;
15  int b = (number >> 0) & 0xFF;
16 
17  output("%d %d %d COLOR\n", r, g, b);
18  }
19  else
20  output("%d GRAY\n", number);
21 }
float b
Definition: named_colr.c:8
float r
Definition: named_colr.c:8
int true_color
void PS_color(int number)
Definition: psdriver/Color.c:5
int NCOLORS
Definition: driver/init.c:30
float g
Definition: named_colr.c:8
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
void output(const char *fmt,...)