Graphviz 12.0.1~dev.20240715.2254
|
API colorprocs.h. More...
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <common/arith.h>
#include <common/color.h>
#include <common/colorprocs.h>
#include <common/colortbl.h>
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/gv_ctype.h>
#include <cgraph/gv_math.h>
#include <cgraph/strcasecmp.h>
#include <cgraph/unreachable.h>
Go to the source code of this file.
Macros | |
#define | DFLT_SCHEME "X11/" /* Must have final '/' */ |
#define | DFLT_SCHEME_LEN ((sizeof(DFLT_SCHEME)-1)/sizeof(char)) |
#define | ISNONDFLT(s) ((s) && *(s) && strncasecmp(DFLT_SCHEME, s, DFLT_SCHEME_LEN-1)) |
Functions | |
static void | hsv2rgb (double h, double s, double v, double *r, double *g, double *b) |
static void | rgb2hsv (double r, double g, double b, double *h, double *s, double *v) |
static int | colorcmpf (const void *p0, const void *p1) |
char * | canontoken (char *str) |
static char * | fullColor (agxbuf *xb, const char *prefix, const char *str) |
static char * | resolveColor (char *str) |
int | colorxlate (char *str, gvcolor_t *color, color_type_t target_type) |
char * | setColorScheme (const char *s) |
Variables | |
static char * | colorscheme |
#define DFLT_SCHEME "X11/" /* Must have final '/' */ |
Definition at line 181 of file colxlate.c.
#define DFLT_SCHEME_LEN ((sizeof(DFLT_SCHEME)-1)/sizeof(char)) |
Definition at line 182 of file colxlate.c.
#define ISNONDFLT | ( | s | ) | ((s) && *(s) && strncasecmp(DFLT_SCHEME, s, DFLT_SCHEME_LEN-1)) |
Definition at line 183 of file colxlate.c.
char * canontoken | ( | char * | str | ) |
Definition at line 129 of file colxlate.c.
References agxbdisown(), agxbputc(), canon(), gv_tolower(), and str.
Referenced by gvrender_resolve_color().
|
static |
Definition at line 124 of file colxlate.c.
int colorxlate | ( | char * | str, |
gvcolor_t * | color, | ||
color_type_t | target_type | ||
) |
Definition at line 217 of file colxlate.c.
References A, agxbfree(), agxbputc(), agxbuse(), B, canon(), color(), COLOR_INDEX, color_lib, COLOR_MALLOC_FAIL, COLOR_OK, COLOR_STRING, COLOR_UNKNOWN, colorcmpf(), free(), G, gv_isdigit(), hsv2rgb(), HSVA_DOUBLE, last, NULL, resolveColor(), rgb2hsv(), RGBA_BYTE, RGBA_DOUBLE, RGBA_WORD, agxbuf::s, S, str, agxbuf::u, UNREACHABLE, and V.
|
static |
Definition at line 144 of file colxlate.c.
References agxbprint(), agxbuse(), prefix, and str.
Referenced by resolveColor().
|
static |
Definition at line 35 of file colxlate.c.
References UNREACHABLE.
Referenced by colorxlate().
|
static |
Definition at line 185 of file colxlate.c.
References agxbfree(), colorscheme, DFLT_SCHEME, DFLT_SCHEME_LEN, fullColor(), ISNONDFLT, on_heap(), and str.
Referenced by colorxlate().
|
static |
Definition at line 91 of file colxlate.c.
References is_exactly_equal().
Referenced by colorxlate().
char * setColorScheme | ( | const char * | s | ) |
set current color scheme for resolving names
Callers should eventually free the returned pointer from this function.
s | Color scheme to set |
Definition at line 414 of file colxlate.c.
References colorscheme, gv_strdup(), and NULL.
Referenced by emit_begin_node(), emit_clusters(), emit_edge_graphics(), emit_end_node(), emit_page(), and object_color().
|
static |
Definition at line 33 of file colxlate.c.
Referenced by resolveColor(), and setColorScheme().