+ case RGB:
+ {
+ int scale = 10 * 8; /* 8 sec */
+ static const unsigned short colors[][3] = {
+ { 0xFFFF, 0x0000, 0x0000 },
+ { 0x0000, 0xFFFF, 0x0000 },
+ { 0x0000, 0x0000, 0xFFFF },
+ { 0xFFFF, 0xFFFF, 0x0000 },
+ { 0xFFFF, 0x0000, 0xFFFF },
+ { 0x0000, 0xFFFF, 0xFFFF },
+ { 0xFFFF, 0xFFFF, 0xFFFF },
+ { 0x0000, 0x0000, 0x0000 },
+ };
+ static unsigned long last = 0;
+ XColor xc;
+ bg = st->bg2;
+ xc.red = colors[st->color_tick / scale][0];
+ xc.green = colors[st->color_tick / scale][1];
+ xc.blue = colors[st->color_tick / scale][2];
+ if (last) XFreeColors (st->dpy, st->xgwa.colormap, &last, 1, 0);
+ XAllocColor (st->dpy, st->xgwa.colormap, &xc);
+ last = xc.pixel;
+ XSetForeground (st->dpy, bg, xc.pixel);
+ st->color_tick = (st->color_tick + 1) % (countof(colors) * scale);
+ /* fall through */
+ }