32 static int translate_or_add_color(
const char *str)
45 for (i = 0; i < num_names; i++) {
56 for (i = 0; i < ncolors; i++)
69 for (i = 1; i < ncolors; i++)
70 if (colors[i].
r == red && colors[i].
g == grn && colors[i].
b == blu)
73 if (ncolors >= nalloc) {
80 colors[index].
r = red;
81 colors[index].
g = grn;
82 colors[index].
b = blu;
105 color = translate_or_add_color(str);
108 if (color == 0 && !none_acceptable)
151 if (color < ncolors) {
152 const struct color_rgb *c = &colors[color];
197 if (color >= ncolors)
int G_num_standard_colors(void)
Get number of named colors (RGB triplets)
int G_str_to_color(const char *, int *, int *, int *)
Parse color string and set red,green,blue.
int G_num_standard_color_names(void)
Get number of named colors (color names)
struct color_rgb G_standard_color_rgb(int)
Get RGB triplet of given color.
const struct color_name * G_standard_color_name(int)
Get color name.
char * G_tolcase(char *)
convert string to lower case
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
char * G_chop(char *)
Chop leading and trailing white spaces.
void COM_Standard_color(int number)
void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
int D_use_color(int color)
draw with a color from D_parse_color
void D_RGB_color(int red, int grn, int blu)
int D_color_number_to_RGB(int color, int *r, int *g, int *b)
get RGB values from color number
int D_parse_color(const char *str, int none_acceptable)
color option text to usable color number
int D_translate_color(const char *str)
color name to number