]> granicus.if.org Git - graphviz/commitdiff
smyrna set_color_theme_color: remove 'smooth' parameter
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 26 Sep 2021 00:04:00 +0000 (17:04 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 28 Sep 2021 02:17:05 +0000 (19:17 -0700)
This function is only ever called with `1` as this value.

cmd/smyrna/viewport.c

index 9d806a16934fb3ffdb08c43c89a5f7ac127e0172..2c47f832e597ea0a196a9ff05aec60e08bf71c40 100644 (file)
@@ -700,35 +700,22 @@ void getcolorfromschema(colorschemaset * sc, float l, float maxl,
 /* set_color_theme_color:
  * Convert colors as strings to RGB
  */
-static void set_color_theme_color(colorschemaset * sc, char **colorstr, int smooth)
+static void set_color_theme_color(colorschemaset * sc, char **colorstr)
 {
     int ind;
     int colorcnt = sc->schemacount;
     gvcolor_t cl;
     float av_perc;
 
-    sc->smooth = smooth;
-    if (smooth) {
-       av_perc = 1.0 / (float) (colorcnt-1);
-       for (ind = 0; ind < colorcnt; ind++) {
-           colorxlate(colorstr[ind], &cl, RGBA_DOUBLE);
-           sc->s[ind].c.R = cl.u.RGBA[0];
-           sc->s[ind].c.G = cl.u.RGBA[1];
-           sc->s[ind].c.B = cl.u.RGBA[2];
-           sc->s[ind].c.A = cl.u.RGBA[3];
-           sc->s[ind].perc = ind * av_perc;
-       }
-    }
-    else {
-       av_perc = 1.0 / (float) (colorcnt);
-       for (ind = 0; ind < colorcnt; ind++) {
-           colorxlate(colorstr[ind], &cl, RGBA_DOUBLE);
-           sc->s[ind].c.R = cl.u.RGBA[0];
-           sc->s[ind].c.G = cl.u.RGBA[1];
-           sc->s[ind].c.B = cl.u.RGBA[2];
-           sc->s[ind].c.A = cl.u.RGBA[3];
-           sc->s[ind].perc = (ind+1) * av_perc;
-       }
+    sc->smooth = 1;
+    av_perc = 1.0 / (float) (colorcnt-1);
+    for (ind = 0; ind < colorcnt; ind++) {
+        colorxlate(colorstr[ind], &cl, RGBA_DOUBLE);
+        sc->s[ind].c.R = cl.u.RGBA[0];
+        sc->s[ind].c.G = cl.u.RGBA[1];
+        sc->s[ind].c.B = cl.u.RGBA[2];
+        sc->s[ind].c.A = cl.u.RGBA[3];
+        sc->s[ind].perc = ind * av_perc;
     }
 }
 
@@ -778,7 +765,7 @@ static colorschemaset *create_color_theme(int themeid)
 
     s->schemacount = palette[themeid].cnt;
     s->s = N_NEW(s->schemacount,colorschema);
-    set_color_theme_color(s, palette[themeid].colors, 1);
+    set_color_theme_color(s, palette[themeid].colors);
 
     return s;
 }