Graphviz 13.0.0~dev.20241220.2304
|
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 <util/agxbuf.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/gv_math.h>
#include <util/strcasecmp.h>
#include <util/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) |
static char * | fullColor (agxbuf *xb, const char *prefix, const char *str) |
static char * | resolveColor (const char *str) |
int | colorxlate (const 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 169 of file colxlate.c.
#define DFLT_SCHEME_LEN ((sizeof(DFLT_SCHEME)-1)/sizeof(char)) |
Definition at line 170 of file colxlate.c.
#define ISNONDFLT | ( | s | ) | ((s) && *(s) && strncasecmp(DFLT_SCHEME, s, DFLT_SCHEME_LEN-1)) |
Definition at line 171 of file colxlate.c.
|
static |
Definition at line 124 of file colxlate.c.
int colorxlate | ( | const char * | str, |
gvcolor_t * | color, | ||
color_type_t | target_type | ||
) |
Definition at line 203 of file colxlate.c.
References hsvrgbacolor_t::a, A, agxbfree(), agxbputc(), agxbuse(), hsvrgbacolor_t::b, B, canon(), color(), COLOR_INDEX, color_lib, COLOR_MALLOC_FAIL, COLOR_OK, COLOR_STRING, COLOR_UNKNOWN, colorcmpf(), free(), hsvrgbacolor_t::g, G, gv_isdigit(), hsvrgbacolor_t::h, hsv2rgb(), HSVA_DOUBLE, NULL, hsvrgbacolor_t::r, resolveColor(), rgb2hsv(), RGBA_BYTE, RGBA_DOUBLE, RGBA_WORD, hsvrgbacolor_t::s, S, str, UNREACHABLE, hsvrgbacolor_t::v, and V.
|
static |
Definition at line 132 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 173 of file colxlate.c.
References agxbfree(), colorscheme, DFLT_SCHEME, DFLT_SCHEME_LEN, fullColor(), ISNONDFLT, NULL, 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 395 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().