GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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:54
struct color_rgb G_standard_color_rgb(int)
Get RGB triplet of given color.
Definition: color_str.c:64
void COM_Standard_color(int number)
Definition: driver/color.c:11
void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
Definition: driver/color.c:5
float g
Definition: named_colr.c:7
double b
Definition: r_raster.c:39
double r
Definition: r_raster.c:39
unsigned char g
Definition: colors.h:38
unsigned char b
Definition: colors.h:38
unsigned char r
Definition: colors.h:38
Definition: driver.h:21
void(* Color)(int, int, int)
Definition: driver.h:43