]> granicus.if.org Git - graphviz/commitdiff
gvmap: remove 'lightness' parameter from 'map_palette_optimal_coloring'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 28 May 2022 05:43:30 +0000 (22:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Aug 2022 15:07:56 +0000 (08:07 -0700)
This is always passed as "0,100".

cmd/gvmap/gvmap.c
cmd/gvmap/make_map.c
cmd/gvmap/make_map.h

index 46432d3a6fb0977a0b2d169c936982ebadf5abd3..d1b7bd2ae897e4935c20df303ec6102a96097780 100644 (file)
@@ -370,7 +370,7 @@ makeMap (SparseMatrix graph, int n, double* x, double* width, int* grouping,
   if (pm->color_optimize && country_graph && rgb_r && rgb_g && rgb_b) 
     map_optimal_coloring(pm->seed, country_graph, rgb_r,  rgb_g, rgb_b);
   else if (pm->color_scheme_str){
-    map_palette_optimal_coloring(pm->color_scheme_str, "0,100", country_graph, 0.01, -10,
+    map_palette_optimal_coloring(pm->color_scheme_str, country_graph, 0.01, -10,
                &rgb_r, &rgb_g, &rgb_b);
   }
 
index abc112423ab7aa58491d6b424e1cf81d4d5f6630..3b238171dc202b756046f1c4e432ea173ca7b1db 100644 (file)
@@ -28,7 +28,7 @@
 #include <edgepaint/lab.h>
 #include <edgepaint/node_distinct_coloring.h>
 
-void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMatrix A0, double accuracy, int seed, 
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, double accuracy, int seed, 
                                  float **rgb_r, float **rgb_g, float **rgb_b){
   /*
     for a graph A, get a distinctive color of its nodes so that the color distanmce among all nodes are maximized. Here
@@ -36,8 +36,6 @@ void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMat
     accuracy is the threshold given so that when finding the coloring for each node, the optimal is
     with in "accuracy" of the true global optimal.
     color_scheme: rgb, gray, lab, or one of the color palettes in color_palettes.h, or a list of hex rgb colors separaterd by comma like "#ff0000,#00ff00"
-    lightness: of the form 0,70, specifying the range of lightness of LAB color. Ignored if scheme is not COLOR_LAB.
-    .          if NULL, 0,70 is assumed
     A: the graph of n nodes
     accuracy: how accurate to find the optimal
     cdim: dimension of the color space
@@ -63,6 +61,10 @@ void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMat
     SparseMatrix_export(stdout, A);
   }
 
+  // lightness: of the form 0,70, specifying the range of lightness of LAB
+  // color. Ignored if scheme is not COLOR_LAB.
+  char *lightness = "0,100";
+
   node_distinct_coloring(color_scheme, lightness, weightedQ, A, accuracy, seed,
                          &cdim, &colors);
 
index c06091997a84cdc7cc3d62d49f82685c6c0f4a6b..156ce2d5c23e91ad9251b614d404ea2069c5c8d9 100644 (file)
@@ -28,7 +28,7 @@ void plot_dot_map(Agraph_t* gr, int n, int dim, double *x, SparseMatrix polys,
                   const char* opacity, SparseMatrix A, FILE*);
 
 void map_optimal_coloring(int seed, SparseMatrix A, float *rgb_r,  float *rgb_g, float *rgb_b);
-void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMatrix A, double accuracy, int seed, float **rgb_r, float **rgb_g, float **rgb_b);
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A, double accuracy, int seed, float **rgb_r, float **rgb_g, float **rgb_b);
 
 enum {POLY_LINE_REAL_EDGE, POLY_LINE_NOT_REAL_EDGE};
 #define neighbor(t, i, edim, elist) elist[(edim)*(t)+i]