GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
driver/Color.c
Go to the documentation of this file.
1
#include <grass/colors.h>
2
#include "
driver.h
"
3
#include "
driverlib.h
"
4
5
int
DRV_lookup_color
(
int
r
,
int
g
,
int
b
)
6
{
7
if
(
driver
->
lookup_color
)
8
return
(*
driver
->
lookup_color
) (
r
,
g
,
b
);
9
return
0;
10
}
11
12
void
DRV_color
(
int
number)
13
{
14
if
(
driver
->
color
)
15
(*
driver
->
color
) (number);
16
}
17
18
19
void
COM_Color_RGB
(
unsigned
char
r
,
unsigned
char
g
,
unsigned
char
b
)
20
{
21
DRV_color
(
DRV_lookup_color
(r, g, b));
22
}
23
24
void
COM_Standard_color
(
int
number)
25
{
26
struct
color_rgb rgb;
27
28
if
(number < 0 || number >=
G_num_standard_colors
())
29
return
;
30
31
rgb =
G_standard_color_rgb
(number);
32
COM_Color_RGB
(rgb.r, rgb.g, rgb.b);
33
}
lib
driver
Color.c
Generated on Sun Sep 9 2012 18:55:30 for GRASS Programmer's Manual by
1.8.1.2