From: erg Date: Thu, 12 Jul 2007 16:47:57 +0000 (+0000) Subject: We use black as the default color. This is not recognized if a colorscheme X-Git-Tag: LAST_LIBGRAPH~32^2~5526 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b20fa662f4a9c99b45a9dcbcea1c72a2288362db;p=graphviz We use black as the default color. This is not recognized if a colorscheme is set. Thus, we make sure black is always recognized. See note about a better solution when the codegens go away. --- diff --git a/lib/common/colxlate.c b/lib/common/colxlate.c index d9aff9619..fb3853826 100644 --- a/lib/common/colxlate.c +++ b/lib/common/colxlate.c @@ -181,6 +181,10 @@ static char* fullColor (char* prefix, char* str) /* resolveColor: * Resolve input color str allowing color scheme namespaces. + * 0) "black" => "black" + * NB: This is something of a hack due to the remaining codegen. + * Once these are gone, this case could be removed and all references + * to "black" could be replaced by "/X11/black". * 1) No initial / => * if colorscheme is defined and no "X11", return /colorscheme/str * else return str @@ -215,7 +219,8 @@ static char* resolveColor (char* str) char* ss; /* second slash */ char* c2; /* second char */ - if (*str == '/') { /* if begins with '/' */ + if ((*str == 'b') || !strncmp(str+1,"lack",4)) return str; + else if (*str == '/') { /* if begins with '/' */ c2 = str+1; if ((ss = strchr(c2, '/'))) { /* if has second '/' */ if (*c2 == '/') { /* if second '/' is second character */