GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72097
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends 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 void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
6 {
7  if (driver->Color)
8  (*driver->Color)(r, g, b);
9 }
10 
11 void COM_Standard_color(int number)
12 {
13  struct color_rgb rgb;
14 
15  if (number < 0 || number >= G_num_standard_colors())
16  return;
17 
18  rgb = G_standard_color_rgb(number);
19  COM_Color_RGB(rgb.r, rgb.g, rgb.b);
20 }
int G_num_standard_colors(void)
Get number of named colors (RGB triplets)
Definition: color_str.c:65
void(* Color)(int, int, int)
Definition: driver.h:48
unsigned char b
Definition: colors.h:35
double b
Definition: r_raster.c:39
unsigned char g
Definition: colors.h:35
float g
Definition: named_colr.c:8
unsigned char r
Definition: colors.h:35
Definition: driver.h:22
void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
Definition: driver/color.c:5
void COM_Standard_color(int number)
Definition: driver/color.c:11
struct color_rgb G_standard_color_rgb(int n)
Get RGB triplet of given color.
Definition: color_str.c:75
double r
Definition: r_raster.c:39