| GRASS 8 Programmer's Manual
    8.5.0dev(2025)-9d806b45d8
    | 
#include <grass/gis.h>

Go to the source code of this file.
| Functions | |
| int | G_num_standard_colors (void) | 
| Get number of named colors (RGB triplets)  More... | |
| struct color_rgb | G_standard_color_rgb (int) | 
| Get RGB triplet of given color.  More... | |
| int | G_num_standard_color_names (void) | 
| Get number of named colors (color names)  More... | |
| const struct color_name * | G_standard_color_name (int) | 
| Get color name.  More... | |
| int | G_str_to_color (const char *, int *, int *, int *) | 
| Parse color string and set red,green,blue.  More... | |
| void | G_rgb_to_hsv (int, int, int, float *, float *, float *) | 
| Converts RGB color values to HSV format.  More... | |
| void | G_color_to_str (int, int, int, ColorFormat, char *) | 
| Parse red,green,blue and set color string.  More... | |
| ColorFormat | G_option_to_color_format (const struct Option *) | 
| Get color format from the option.  More... | |
| void G_color_to_str | ( | int | r, | 
| int | g, | ||
| int | b, | ||
| ColorFormat | clr_frmt, | ||
| char * | str | ||
| ) | 
Parse red,green,blue and set color string.
| r | red component of RGB color | |
| g | green component of RGB color | |
| b | blue component of RGB color | |
| clr_frmt | color format to be used (RGB, HEX, HSV, TRIPLET). | |
| [out] | str | color string | 
Definition at line 210 of file color_str.c.
| int G_num_standard_color_names | ( | void | ) | 
Get number of named colors (color names)
Definition at line 76 of file color_str.c.
Referenced by G_str_to_color().
| int G_num_standard_colors | ( | void | ) | 
Get number of named colors (RGB triplets)
Definition at line 56 of file color_str.c.
Referenced by COM_Standard_color(), and D_use_color().
| ColorFormat G_option_to_color_format | ( | const struct Option * | option | ) | 
Get color format from the option.
| option | pointer to color format option | 
Definition at line 254 of file color_str.c.
References _, Option::answer, G_fatal_error(), HEX, HSV, RGB, and TRIPLET.
| void G_rgb_to_hsv | ( | int | r, | 
| int | g, | ||
| int | b, | ||
| float * | h, | ||
| float * | s, | ||
| float * | v | ||
| ) | 
Converts RGB color values to HSV format.
| r | red component of the RGB color | |
| g | green component of the RGB color | |
| b | blue component of the RGB color | |
| [out] | h | pointer to store the calculated hue | 
| [out] | s | pointer to store the calculated saturation | 
| [out] | v | pointer to store the calculated value | 
Definition at line 168 of file color_str.c.
| const struct color_name* G_standard_color_name | ( | int | n | ) | 
| struct color_rgb G_standard_color_rgb | ( | int | n | ) | 
Get RGB triplet of given color.
| n | color index | 
Definition at line 56 of file color_str.c.
Referenced by COM_Standard_color().
| int G_str_to_color | ( | const char * | str, | 
| int * | red, | ||
| int * | grn, | ||
| int * | blu | ||
| ) | 
Parse color string and set red,green,blue.
| str | color string | |
| [out] | red | red value | 
| [out] | grn | green value | 
| [out] | blu | blue value | 
Definition at line 103 of file color_str.c.
References G_chop(), G_debug(), G_num_standard_color_names(), G_strcasecmp(), G_strlcpy(), and name.
Referenced by Cairo_Graph_set(), I_iclass_add_signature(), Nviz_color_from_str(), and PNG_Graph_set().