GRASS Programmer's Manual
6.4.4(2014)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
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
}
b
float b
Definition:
named_colr.c:8
r
float r
Definition:
named_colr.c:8
psdriver.h
G_warning
int G_warning(const char *msg,...)
Print a warning message to stderr.
Definition:
lib/gis/error.c:178
true_color
int true_color
Definition:
pngdriver/Graph_set.c:28
PS_color
void PS_color(int number)
Definition:
psdriver/Color.c:5
NCOLORS
int NCOLORS
Definition:
driver/init.c:30
g
float g
Definition:
named_colr.c:8
output
void output(const char *fmt,...)
Definition:
psdriver/Graph_set.c:224
lib
psdriver
Color.c
Generated on Fri Sep 5 2014 08:29:27 for GRASS Programmer's Manual by
1.8.8