GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
driver/color.c
Go to the documentation of this file.
1#include <grass/colors.h>
2#include "driver.h"
3#include "driverlib.h"
4
5void 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
11void 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 n)
Get RGB triplet of given color.
Definition color_str.c:64
void COM_Standard_color(int number)
void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
Definition driver/color.c:5
double b
double r
float g
Definition named_colr.c:7
void(* Color)(int, int, int)
Definition driver.h:43