- if (cycle_p)
- {
- unsigned long plane_masks;
- /* allocate the writable color cells, one at a time. */
- if (! XAllocColorCells (dsp, cmap, False, &plane_masks, 0,
- &fg_color.pixel, 1))
- {
- fprintf (stderr,
- "%s: couldn't allocate %s writable color cells. Turning off -cycle.\n",
- progname, (npixels ? "enough" : "any"));
- cycle_p = 0;
- goto NON_CYCLE;
- }
- XStoreColor (dsp, cmap, &fg_color);
- }
- else
- {
- NON_CYCLE:
- if (!XAllocColor (dsp, cmap, &fg_color))
- break;
- }
- pixels[npixels] = fg_color.pixel;
-
- switch (this_mode)
- {
- case MODE_H: fg_h = (fg_h + shift) % 360; break;
- case MODE_S: fg_s += dshift; break;
- case MODE_V: fg_v += dshift; break;
- default: abort ();
- }
- hsv_to_rgb (fg_h, fg_s, fg_v,
- &fg_color.red, &fg_color.green, &fg_color.blue);
+ int i;
+ done = True;
+ colors[0].pixel = fg_pixel;
+ for (i = 1; i < ncolors; i++)
+ colors[i].pixel = bg_pixel;