Dear rxvt users,

It has been supplied an optional feature which supports 256 index colors
against cvs version (April 16, 2002) or rxvt-2.7.8.  That's so colorful :)


What to do:
  o Apply this patch against rxvt souces.
  o Run sh .prebuild for recreate configure script.
  o And run ./configure --enable-256-color (and more options if you
    want).  Then make or make rxvt.
  o You colud test 256 colors feature with perl script "256colors2.pl"
    bundled xterm source (XFree86 4.x).


Escape Sequence:
  o ESC ] 4 ; Ps ; Pt ESC \	(set color; XTerm Escape Sequence)
      Ps = 0-255  The index of color.
      Pt          A string must be able to recognize by XParseColor(3).

  o ESC [ Ps ; 5 ; Ps m		(select color; Enhanced SGR by XTerm?)
      Ps (first) = 38 / 48  Select fg/bg color.
      Ps (second) = 0-255   The index of color.


Many thanks,

Kazutoshi Kubota <yakk@bb.din.or.jp>
		 <tu7k-kbt@asahi-net.or.jp>


diff -urN rxvt.orig/autoconf/acconfig.h rxvt/autoconf/acconfig.h
--- rxvt.orig/autoconf/acconfig.h	Wed Aug  1 13:09:08 2001
+++ rxvt/autoconf/acconfig.h	Mon May  6 15:36:28 2002
@@ -119,6 +119,9 @@
 /* Define to use "smart" resize behavior */
 #undef SMART_RESIZE
 
+/* Define if you want 256-color support */
+#undef TTY_256COLOR
+
 /* ------------------------------------------------------------------------- */
 /* --                     CONFIGURE DETECTED FEATURES                     -- */
 /* ------------------------------------------------------------------------- */
diff -urN rxvt.orig/autoconf/configure.in rxvt/autoconf/configure.in
--- rxvt.orig/autoconf/configure.in	Wed Jan 23 02:49:27 2002
+++ rxvt/autoconf/configure.in	Mon May  6 15:36:28 2002
@@ -303,6 +303,12 @@
     AC_DEFINE(SMART_RESIZE)
   fi])
 
+AC_ARG_ENABLE(256-color,
+  [  --enable-256-color      enable 256-color support],
+  [if test x$enableval = xyes; then
+    AC_DEFINE(TTY_256COLOR)
+  fi])
+
 AC_ARG_WITH(term,
   [  --with-term=NAME        set the terminal to NAME (default \"xterm\")],
   [if test x$withval != x; then
diff -urN rxvt.orig/src/command.c rxvt/src/command.c
--- rxvt.orig/src/command.c	Tue Apr  9 11:16:22 2002
+++ rxvt/src/command.c	Mon May  6 15:36:28 2002
@@ -2717,6 +2717,15 @@
 	    rxvt_scr_color(r, (unsigned int)(minCOLOR + (arg[i] - 30)),
 			   Color_fg);
 	    break;
+#ifdef TTY_256COLOR
+	case 38:
+	    if (nargs > i + 2 && arg[i + 1] == 5) {
+		rxvt_scr_color(r, (unsigned int)(minCOLOR + arg[i + 2]),
+			       Color_fg);
+		i += 2;
+	    }
+	    break;
+#endif
 	case 39:		/* default fg */
 	    rxvt_scr_color(r, Color_fg, Color_fg);
 	    break;
@@ -2732,6 +2741,15 @@
 	    rxvt_scr_color(r, (unsigned int)(minCOLOR + (arg[i] - 40)),
 			   Color_bg);
 	    break;
+#ifdef TTY_256COLOR
+	case 48:
+	    if (nargs > i + 2 && arg[i + 1] == 5) {
+		rxvt_scr_color(r, (unsigned int)(minCOLOR + arg[i + 2]),
+			       Color_bg);
+		i += 2;
+	    }
+	    break;
+#endif
 	case 49:		/* default bg */
 	    rxvt_scr_color(r, Color_bg, Color_bg);
 	    break;
diff -urN rxvt.orig/src/init.c rxvt/src/init.c
--- rxvt.orig/src/init.c	Tue Apr  9 15:53:02 2002
+++ rxvt/src/init.c	Mon May  6 15:36:28 2002
@@ -68,6 +68,248 @@
     "Magenta",			/* 5/13: bright magenta (#FF00FF) */
     "Cyan",			/* 6/14: bright cyan    (#00FFFF) */
     "White",			/* 7/15: bright white   (#FFFFFF) */
+#ifdef TTY_256COLOR
+    "rgb:00/00/00",		/* default 16-255 color table     */
+    "rgb:00/00/2a",
+    "rgb:00/00/55",
+    "rgb:00/00/7f",
+    "rgb:00/00/aa",
+    "rgb:00/00/d4",
+    "rgb:00/2a/00",
+    "rgb:00/2a/2a",
+    "rgb:00/2a/55",
+    "rgb:00/2a/7f",
+    "rgb:00/2a/aa",
+    "rgb:00/2a/d4",
+    "rgb:00/55/00",
+    "rgb:00/55/2a",
+    "rgb:00/55/55",
+    "rgb:00/55/7f",
+    "rgb:00/55/aa",
+    "rgb:00/55/d4",
+    "rgb:00/7f/00",
+    "rgb:00/7f/2a",
+    "rgb:00/7f/55",
+    "rgb:00/7f/7f",
+    "rgb:00/7f/aa",
+    "rgb:00/7f/d4",
+    "rgb:00/aa/00",
+    "rgb:00/aa/2a",
+    "rgb:00/aa/55",
+    "rgb:00/aa/7f",
+    "rgb:00/aa/aa",
+    "rgb:00/aa/d4",
+    "rgb:00/d4/00",
+    "rgb:00/d4/2a",
+    "rgb:00/d4/55",
+    "rgb:00/d4/7f",
+    "rgb:00/d4/aa",
+    "rgb:00/d4/d4",
+    "rgb:2a/00/00",
+    "rgb:2a/00/2a",
+    "rgb:2a/00/55",
+    "rgb:2a/00/7f",
+    "rgb:2a/00/aa",
+    "rgb:2a/00/d4",
+    "rgb:2a/2a/00",
+    "rgb:2a/2a/2a",
+    "rgb:2a/2a/55",
+    "rgb:2a/2a/7f",
+    "rgb:2a/2a/aa",
+    "rgb:2a/2a/d4",
+    "rgb:2a/55/00",
+    "rgb:2a/55/2a",
+    "rgb:2a/55/55",
+    "rgb:2a/55/7f",
+    "rgb:2a/55/aa",
+    "rgb:2a/55/d4",
+    "rgb:2a/7f/00",
+    "rgb:2a/7f/2a",
+    "rgb:2a/7f/55",
+    "rgb:2a/7f/7f",
+    "rgb:2a/7f/aa",
+    "rgb:2a/7f/d4",
+    "rgb:2a/aa/00",
+    "rgb:2a/aa/2a",
+    "rgb:2a/aa/55",
+    "rgb:2a/aa/7f",
+    "rgb:2a/aa/aa",
+    "rgb:2a/aa/d4",
+    "rgb:2a/d4/00",
+    "rgb:2a/d4/2a",
+    "rgb:2a/d4/55",
+    "rgb:2a/d4/7f",
+    "rgb:2a/d4/aa",
+    "rgb:2a/d4/d4",
+    "rgb:55/00/00",
+    "rgb:55/00/2a",
+    "rgb:55/00/55",
+    "rgb:55/00/7f",
+    "rgb:55/00/aa",
+    "rgb:55/00/d4",
+    "rgb:55/2a/00",
+    "rgb:55/2a/2a",
+    "rgb:55/2a/55",
+    "rgb:55/2a/7f",
+    "rgb:55/2a/aa",
+    "rgb:55/2a/d4",
+    "rgb:55/55/00",
+    "rgb:55/55/2a",
+    "rgb:55/55/55",
+    "rgb:55/55/7f",
+    "rgb:55/55/aa",
+    "rgb:55/55/d4",
+    "rgb:55/7f/00",
+    "rgb:55/7f/2a",
+    "rgb:55/7f/55",
+    "rgb:55/7f/7f",
+    "rgb:55/7f/aa",
+    "rgb:55/7f/d4",
+    "rgb:55/aa/00",
+    "rgb:55/aa/2a",
+    "rgb:55/aa/55",
+    "rgb:55/aa/7f",
+    "rgb:55/aa/aa",
+    "rgb:55/aa/d4",
+    "rgb:55/d4/00",
+    "rgb:55/d4/2a",
+    "rgb:55/d4/55",
+    "rgb:55/d4/7f",
+    "rgb:55/d4/aa",
+    "rgb:55/d4/d4",
+    "rgb:7f/00/00",
+    "rgb:7f/00/2a",
+    "rgb:7f/00/55",
+    "rgb:7f/00/7f",
+    "rgb:7f/00/aa",
+    "rgb:7f/00/d4",
+    "rgb:7f/2a/00",
+    "rgb:7f/2a/2a",
+    "rgb:7f/2a/55",
+    "rgb:7f/2a/7f",
+    "rgb:7f/2a/aa",
+    "rgb:7f/2a/d4",
+    "rgb:7f/55/00",
+    "rgb:7f/55/2a",
+    "rgb:7f/55/55",
+    "rgb:7f/55/7f",
+    "rgb:7f/55/aa",
+    "rgb:7f/55/d4",
+    "rgb:7f/7f/00",
+    "rgb:7f/7f/2a",
+    "rgb:7f/7f/55",
+    "rgb:7f/7f/7f",
+    "rgb:7f/7f/aa",
+    "rgb:7f/7f/d4",
+    "rgb:7f/aa/00",
+    "rgb:7f/aa/2a",
+    "rgb:7f/aa/55",
+    "rgb:7f/aa/7f",
+    "rgb:7f/aa/aa",
+    "rgb:7f/aa/d4",
+    "rgb:7f/d4/00",
+    "rgb:7f/d4/2a",
+    "rgb:7f/d4/55",
+    "rgb:7f/d4/7f",
+    "rgb:7f/d4/aa",
+    "rgb:7f/d4/d4",
+    "rgb:aa/00/00",
+    "rgb:aa/00/2a",
+    "rgb:aa/00/55",
+    "rgb:aa/00/7f",
+    "rgb:aa/00/aa",
+    "rgb:aa/00/d4",
+    "rgb:aa/2a/00",
+    "rgb:aa/2a/2a",
+    "rgb:aa/2a/55",
+    "rgb:aa/2a/7f",
+    "rgb:aa/2a/aa",
+    "rgb:aa/2a/d4",
+    "rgb:aa/55/00",
+    "rgb:aa/55/2a",
+    "rgb:aa/55/55",
+    "rgb:aa/55/7f",
+    "rgb:aa/55/aa",
+    "rgb:aa/55/d4",
+    "rgb:aa/7f/00",
+    "rgb:aa/7f/2a",
+    "rgb:aa/7f/55",
+    "rgb:aa/7f/7f",
+    "rgb:aa/7f/aa",
+    "rgb:aa/7f/d4",
+    "rgb:aa/aa/00",
+    "rgb:aa/aa/2a",
+    "rgb:aa/aa/55",
+    "rgb:aa/aa/7f",
+    "rgb:aa/aa/aa",
+    "rgb:aa/aa/d4",
+    "rgb:aa/d4/00",
+    "rgb:aa/d4/2a",
+    "rgb:aa/d4/55",
+    "rgb:aa/d4/7f",
+    "rgb:aa/d4/aa",
+    "rgb:aa/d4/d4",
+    "rgb:d4/00/00",
+    "rgb:d4/00/2a",
+    "rgb:d4/00/55",
+    "rgb:d4/00/7f",
+    "rgb:d4/00/aa",
+    "rgb:d4/00/d4",
+    "rgb:d4/2a/00",
+    "rgb:d4/2a/2a",
+    "rgb:d4/2a/55",
+    "rgb:d4/2a/7f",
+    "rgb:d4/2a/aa",
+    "rgb:d4/2a/d4",
+    "rgb:d4/55/00",
+    "rgb:d4/55/2a",
+    "rgb:d4/55/55",
+    "rgb:d4/55/7f",
+    "rgb:d4/55/aa",
+    "rgb:d4/55/d4",
+    "rgb:d4/7f/00",
+    "rgb:d4/7f/2a",
+    "rgb:d4/7f/55",
+    "rgb:d4/7f/7f",
+    "rgb:d4/7f/aa",
+    "rgb:d4/7f/d4",
+    "rgb:d4/aa/00",
+    "rgb:d4/aa/2a",
+    "rgb:d4/aa/55",
+    "rgb:d4/aa/7f",
+    "rgb:d4/aa/aa",
+    "rgb:d4/aa/d4",
+    "rgb:d4/d4/00",
+    "rgb:d4/d4/2a",
+    "rgb:d4/d4/55",
+    "rgb:d4/d4/7f",
+    "rgb:d4/d4/aa",
+    "rgb:d4/d4/d4",
+    "rgb:08/08/08",
+    "rgb:12/12/12",
+    "rgb:1c/1c/1c",
+    "rgb:26/26/26",
+    "rgb:30/30/30",
+    "rgb:3a/3a/3a",
+    "rgb:44/44/44",
+    "rgb:4e/4e/4e",
+    "rgb:58/58/58",
+    "rgb:62/62/62",
+    "rgb:6c/6c/6c",
+    "rgb:76/76/76",
+    "rgb:80/80/80",
+    "rgb:8a/8a/8a",
+    "rgb:94/94/94",
+    "rgb:9e/9e/9e",
+    "rgb:a8/a8/a8",
+    "rgb:b2/b2/b2",
+    "rgb:bc/bc/bc",
+    "rgb:c6/c6/c6",
+    "rgb:d0/d0/d0",
+    "rgb:da/da/da",
+    "rgb:e4/e4/e4",
+    "rgb:ee/ee/ee",
+#endif
 #ifndef NO_CURSORCOLOR
     COLOR_CURSOR_BACKGROUND,
     COLOR_CURSOR_FOREGROUND,
@@ -126,6 +368,7 @@
 rxvt_init_vars(rxvt_t *r)
 {
     struct rxvt_hidden *h;
+    int i;
 
 #ifndef NULLS_ARE_NOT_ZEROS
     MEMSET(r, 0, sizeof(rxvt_t));
@@ -226,6 +469,8 @@
     h->CurrentBar = &(h->BarList);
 # endif				/* (MENUBAR_MAX > 1) */
 #endif
+    for (i = 0; i < NPIXCLR_SETS; i++)
+	h->pixcolor_set[i] = 0;
     return 0;
 }
 
@@ -659,7 +904,7 @@
 	    }
 	}
 	r->PixColors[i] = xcol.pixel;
-	r->h->pixcolor_set |= 1 << i;
+	r->h->pixcolor_set[i / NPIXCLR_BITS] |= 1 << (i % NPIXCLR_BITS);
     }
 
     if (XDEPTH <= 2 || !r->h->rs[Rs_color + Color_pointer])
diff -urN rxvt.orig/src/main.c rxvt/src/main.c
--- rxvt.orig/src/main.c	Tue Apr  9 11:16:23 2002
+++ rxvt/src/main.c	Mon May  6 15:39:17 2002
@@ -845,13 +845,13 @@
 	    i -= 8;
 # ifndef NO_BRIGHTCOLOR
 	    r->PixColors[idx] = r->PixColors[minBrightCOLOR + i];
-	    r->h->pixcolor_set |= 1 << idx;
+	    r->h->pixcolor_set[idx / NPIXCLR_BITS] |= 1 << (idx % NPIXCLR_BITS);
 	    goto Done;
 # endif
 	}
 	if (i >= 0 && i <= 7) {	/* normal colors */
 	    r->PixColors[idx] = r->PixColors[minCOLOR + i];
-	    r->h->pixcolor_set |= 1 << idx;
+	    r->h->pixcolor_set[idx / NPIXCLR_BITS] |= 1 << (idx % NPIXCLR_BITS);
 	    goto Done;
 	}
     }
@@ -875,7 +875,7 @@
 # endif
 
     r->PixColors[idx] = xcol.pixel;
-    r->h->pixcolor_set |= 1 << idx;
+    r->h->pixcolor_set[idx / NPIXCLR_BITS] |= 1 << (idx % NPIXCLR_BITS);
 
 /* XSetWindowAttributes attr; */
 /* Cursor cursor; */
diff -urN rxvt.orig/src/rxvt.h rxvt/src/rxvt.h
--- rxvt.orig/src/rxvt.h	Tue Apr  9 11:16:23 2002
+++ rxvt/src/rxvt.h	Mon May  6 15:37:20 2002
@@ -328,18 +328,21 @@
 /* all basic bit-flags in first/lower 16 bits */
 
 #define RS_None			0	/* Normal */
+#ifdef TTY_256COLOR
+#define RS_fgMask		0x000001FFu	/* 512 colors */
+#define RS_bgMask		0x0003FE00u	/* 512 colors */
+#else
 #define RS_fgMask		0x0000001Fu	/* 32 colors */
 #define RS_bgMask		0x000003E0u	/* 32 colors */
-#define RS_Bold			0x00000400u	/* bold */
-#define RS_Blink		0x00000800u	/* blink */
-#define RS_RVid			0x00001000u	/* reverse video */
-#define RS_Uline		0x00002000u	/* underline */
-#define RS_acsFont		0x00004000u	/* ACS graphics char set */
-#define RS_ukFont		0x00008000u	/* UK character set */
-#define RS_fontMask		(RS_acsFont|RS_ukFont)
-#define RS_baseattrMask		(RS_Bold|RS_Blink|RS_RVid|RS_Uline)
+#endif
 
 /* all other bit-flags in upper 16 bits */
+#define RS_Bold			0x00040000u	/* bold */
+#define RS_Blink		0x00080000u	/* blink */
+#define RS_RVid			0x00100000u	/* reverse video */
+#define RS_Uline		0x00200000u	/* underline */
+#define RS_acsFont		0x00400000u	/* ACS graphics char set */
+#define RS_ukFont		0x00800000u	/* UK character set */
 
 #ifdef MULTICHAR_SET
 # define RS_multi0		0x10000000u	/* only multibyte characters */
@@ -354,6 +357,8 @@
 # define IS_MULTI2(r)		(0)
 #endif
 
+#define RS_fontMask		(RS_acsFont|RS_ukFont)
+#define RS_baseattrMask		(RS_Bold|RS_Blink|RS_RVid|RS_Uline)
 #define RS_attrMask		(RS_baseattrMask|RS_fontMask|RS_multiMask)
 
 #define Sel_none		0	/* Not waiting */
@@ -435,6 +440,10 @@
 #else
     Color_White = maxCOLOR,
 #endif
+#ifdef TTY_256COLOR
+    min256COLOR = Color_White + 1,
+    max256COLOR = minCOLOR + 255,
+#endif
 #ifndef NO_CURSORCOLOR
     Color_cursor,
     Color_cursor2,
@@ -463,7 +472,18 @@
 #endif
 };
 
-#define DEFAULT_RSTYLE		(RS_None | (Color_fg) | (Color_bg<<5))
+enum {
+#ifdef TTY_256COLOR
+    Color_Bits = 9,
+    NPIXCLR_SETS = 9,
+#else
+    Color_Bits = 5,
+    NPIXCLR_SETS = 1,
+#endif
+    NPIXCLR_BITS = 32
+};
+
+#define DEFAULT_RSTYLE		(RS_None | (Color_fg) | (Color_bg<<Color_Bits))
 
 /*
  * Resource list
@@ -688,7 +708,7 @@
 
 /* how to build & extract colors and attributes */
 #define GET_BASEFG(x)		(((x) & RS_fgMask))
-#define GET_BASEBG(x)		(((x) & RS_bgMask)>>5)
+#define GET_BASEBG(x)		(((x) & RS_bgMask)>>Color_Bits)
 #ifndef NO_BRIGHTCOLOR
 # define GET_FGCOLOR(x)						\
     ((((x) & RS_Bold) == 0					\
@@ -710,10 +730,10 @@
 #define GET_ATTR(x)		(((x) & RS_attrMask))
 #define GET_BGATTR(x)							\
     (((x) & RS_RVid) ? (((x) & (RS_attrMask & ~RS_RVid))		\
-			| (((x) & RS_fgMask)<<5))			\
+			| (((x) & RS_fgMask)<<Color_Bits))		\
 		     : ((x) & (RS_attrMask | RS_bgMask)))
 #define SET_FGCOLOR(x,fg)	(((x) & ~RS_fgMask)  | (fg))
-#define SET_BGCOLOR(x,bg)	(((x) & ~RS_bgMask)  | ((bg)<<5))
+#define SET_BGCOLOR(x,bg)	(((x) & ~RS_bgMask)  | ((bg)<<Color_Bits))
 #define SET_ATTR(x,a)		(((x) & ~RS_attrMask)| (a))
 
 #ifdef HAVE_SCROLLBARS
@@ -906,7 +926,7 @@
 /* ---------- */
     rend_t          rstyle;
 /* ---------- */
-    u_int32_t       pixcolor_set;
+    u_int32_t       pixcolor_set[NPIXCLR_SETS];
 /* ---------- */
     int             csrO,	/* Hops - csr offset in thumb/slider to      */
 				/*   give proper Scroll behaviour            */
diff -urN rxvt.orig/src/rxvtlib.h.in rxvt/src/rxvtlib.h.in
--- rxvt.orig/src/rxvtlib.h.in	Tue Apr  9 11:16:24 2002
+++ rxvt/src/rxvtlib.h.in	Mon May  6 16:59:10 2002
@@ -78,11 +78,7 @@
 } row_col_t;
 
 typedef unsigned char text_t;
-#if defined(MULTICHAR_SET)
-#define rend_t		u_int32_t
-#else
-#define rend_t		u_int16_t
-#endif
+typedef u_int32_t     rend_t;
 
 /*
  * TermWin elements limits
diff -urN rxvt.orig/src/screen.c rxvt/src/screen.c
--- rxvt.orig/src/screen.c	Tue Apr  9 11:16:24 2002
+++ rxvt/src/screen.c	Mon May  6 17:01:34 2002
@@ -1916,7 +1916,6 @@
 #ifndef NO_BOLDFONT
 		    bfont,	/* we've changed font to bold font           */
 #endif
-		    fore, back,	/* desired foreground/background             */
 		    rvid,	/* reverse video this position               */
 		    wbyte;	/* we're in multibyte                        */
     char            morecur = 0;/*                                           */
@@ -1925,6 +1924,7 @@
 		    len, wlen;	/* text length screen/buffer                 */
     int             i,		/* tmp                                       */
 		    row_offset;	/* basic offset in screen structure          */
+    rend_t	    fore, back;	/* desired foreground/background             */
 #ifndef NO_CURSORCOLOR
     rend_t	    cc1;	/* store colours at cursor position(s)       */
 # ifdef MULTICHAR_SET
@@ -1998,7 +1998,7 @@
 	    *srp ^= RS_RVid;
 #ifndef NO_CURSORCOLOR
 	    cc1 = *srp & (RS_fgMask | RS_bgMask);
-	    if (XDEPTH > 2 && (h->pixcolor_set & (1 << Color_cursor)))
+	    if (XDEPTH > 2 && (h->pixcolor_set[Color_cursor / NPIXCLR_BITS] & (1 << (Color_cursor % NPIXCLR_BITS))))
 		ccol1 = Color_cursor;
 	    else
 #ifdef CURSOR_COLOR_IS_RENDITION_COLOR
@@ -2006,7 +2006,7 @@
 #else
 		ccol1 = Color_fg;
 #endif
-	    if (XDEPTH > 2 && (h->pixcolor_set & (1 << Color_cursor2)))
+	    if (XDEPTH > 2 && (h->pixcolor_set[Color_cursor2 / NPIXCLR_BITS] & (1 << (Color_cursor2 % NPIXCLR_BITS))))
 		ccol2 = Color_cursor2;
 	    else
 #ifdef CURSOR_COLOR_IS_RENDITION_COLOR
@@ -2354,7 +2354,7 @@
 	    rvid = (rend & RS_RVid) ? 1 : 0;
 #ifdef OPTION_HC
 	    if (!rvid && (rend & RS_Blink)) {
-		if (XDEPTH > 2 && (h->pixcolor_set & (1 << Color_HC))
+		if (XDEPTH > 2 && (h->pixcolor_set[Color_HC / NPIXCLR_BITS] & (1 << (Color_HC % NPIXCLR_BITS)))
 		    && r->PixColors[fore] != r->PixColors[Color_HC]
 		    && r->PixColors[back] != r->PixColors[Color_HC])
 		    back = Color_HC;
@@ -2365,7 +2365,7 @@
 	    if (rvid) {
 		SWAP_IT(fore, back, unsigned char);
 #ifndef NO_BOLD_UNDERLINE_REVERSE
-		if (XDEPTH > 2 && (h->pixcolor_set & (1 << Color_RV))
+		if (XDEPTH > 2 && (h->pixcolor_set[Color_RV / NPIXCLR_BITS] & (1 << (Color_RV % NPIXCLR_BITS)))
 		    && r->PixColors[fore] != r->PixColors[Color_RV])
 		    back = Color_RV;
 #endif
@@ -2381,7 +23  "rg+