GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
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 }
unsigned char b
Definition: colors.h:35
void(* Color)(int, int, int)
Definition: driver.h:48
double b
Definition: r_raster.c:39
unsigned char g
Definition: colors.h:35
float g
Definition: named_colr.c:8
struct color_rgb G_standard_color_rgb(int)
Get RGB triplet of given color.
Definition: color_str.c:75
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
int G_num_standard_colors(void)
Get number of named colors (RGB triplets)
Definition: color_str.c:65
void COM_Standard_color(int number)
Definition: driver/color.c:11
double r
Definition: r_raster.c:39