- static int ncolors = 0;
- static XColor *colors = 0;
- if (circles [0].increment >= 0)
- inhibit_sleep = True;
- else if (done)
- {
- int fgh, bgh;
- double fgs, fgv, bgs, bgv;
- if (colors)
- for (i = 0; i < ncolors; i++)
- XFreeColors (dpy, cmap, &colors [i].pixel, 1, 0);
-
- rgb_to_hsv (fgc.red, fgc.green, fgc.blue, &fgh, &fgs, &fgv);
- rgb_to_hsv (bgc.red, bgc.green, bgc.blue, &bgh, &bgs, &bgv);
- ncolors = oiterations;
- colors = ((XColor *)
- (colors
- ? realloc (colors, sizeof (XColor) * ncolors)
- : malloc (sizeof (XColor) * ncolors)));
-
- make_color_ramp (bgh, bgs, bgv, fgh, fgs, fgv, colors, ncolors);
- for (i = 0; i < ncolors; i++)
- XAllocColor (dpy, cmap, &colors [i]);
- XSetForeground (dpy, merge_gc, colors [0].pixel);
- }
- else