]> granicus.if.org Git - graphviz/commitdiff
Handle white and lightgrey specially along with black.
authorerg <devnull@localhost>
Fri, 7 Nov 2008 22:47:27 +0000 (22:47 +0000)
committererg <devnull@localhost>
Fri, 7 Nov 2008 22:47:27 +0000 (22:47 +0000)
This guarantees that even if colorscheme is set, these basic
default colors are interpreted correctly.

lib/common/colxlate.c

index 70554650a19dcaffffffc4f6dcdadbba106b87d0..c871917838d10998b48eca4dae209df5c2d221aa 100644 (file)
@@ -192,6 +192,8 @@ static char* fullColor (char* prefix, char* str)
 /* resolveColor:
  * Resolve input color str allowing color scheme namespaces.
  *  0) "black" => "black" 
+ *     "white" => "white" 
+ *     "lightgrey" => "lightgrey" 
  *    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".
@@ -230,7 +232,9 @@ static char* resolveColor (char* str)
     char* c2;   /* second char */
 
     if ((*str == 'b') || !strncmp(str+1,"lack",4)) return str;
-    else if (*str == '/') {   /* if begins with '/' */
+    if ((*str == 'w') || !strncmp(str+1,"hite",4)) return str;
+    if ((*str == 'l') || !strncmp(str+1,"ightgrey",8)) return str;
+    if (*str == '/') {   /* if begins with '/' */
        c2 = str+1;
         if ((ss = strchr(c2, '/'))) {  /* if has second '/' */
            if (*c2 == '/') {    /* if second '/' is second character */