+ st->iteration = 0;
+ st->iterations = 30 + (random() % 70) + (random() % 70);
+ reset_moire2 (st);
+
+ st->flip_a = mono_p ? False : (random() & 1);
+ st->flip_b = mono_p ? False : (random() & 1);
+
+ if (st->flip_b)
+ {
+ XSetForeground(st->dpy, st->window_gc, st->bg_pixel);
+ XSetBackground(st->dpy, st->window_gc, st->fg_pixel);
+ }
+ else
+ {
+ XSetForeground(st->dpy, st->window_gc, st->fg_pixel);
+ XSetBackground(st->dpy, st->window_gc, st->bg_pixel);
+ }
+ }
+
+ if (!mono_p)
+ {
+ st->pix++;
+ st->pix = st->pix % st->ncolors;
+
+ if (st->flip_a)
+ XSetBackground(st->dpy, st->window_gc, st->colors[st->pix].pixel);
+ else
+ XSetForeground(st->dpy, st->window_gc, st->colors[st->pix].pixel);
+ }
+
+
+ moire2 (st);
+ st->iteration++;
+ if (st->iteration >= st->color_shift)
+ {
+ st->iteration = 0;
+ st->iterations--;
+ if (st->iterations <= 0)
+ st->reset = 1;
+ }
+
+ return st->delay;
+}
+
+static void
+moire2_reshape (Display *dpy, Window window, void *closure,
+ unsigned int w, unsigned int h)
+{
+}
+
+static Bool
+moire2_event (Display *dpy, Window window, void *closure, XEvent *event)
+{
+ return False;
+}
+
+static void
+moire2_free (Display *dpy, Window window, void *closure)
+{
+}
+
+static const char *moire2_defaults [] = {