]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix reversed red<->blue color channels.
authorBruno Haible <bruno@clisp.org>
Thu, 30 Nov 2006 13:28:27 +0000 (13:28 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:26 +0000 (12:14 +0200)
gnulib-local/ChangeLog
gnulib-local/lib/term-ostream.oo.c

index 7ec42f3927bf161af436c061bf3d66badd9c3eaa..a31eb4a2da1ee26e5b689014a194cd5dc0e5026c 100644 (file)
@@ -1,3 +1,7 @@
+2006-11-28  Bruno Haible  <bruno@clisp.org>
+
+       * lib/term-ostream.oo.c (out_attr_change): Fix uses of color_bgr.
+
 2006-11-28  Bruno Haible  <bruno@clisp.org>
 
        Guard against interruption with Ctrl-Z.
index 6f58349528004d5dbf3d366d165cd9b73954c0a3..9269b3a625e5c24aa298b5615bd1b4badd6957b4 100644 (file)
@@ -285,7 +285,9 @@ equal_attributes (attributes_t attr1, attributes_t attr2)
          && attr1.underline == attr2.underline);
 }
 
-/* Convert a color in RGB encoding to BGR encoding.  */
+/* Convert a color in RGB encoding to BGR encoding.
+   See the ncurses terminfo.5 manual page, section "Color Handling", for an
+   explanation why this is needed.  */
 static inline int
 color_bgr (term_color_t color)
 {
@@ -329,9 +331,10 @@ out_attr_change (term_ostream_t stream,
       assert (stream->supports_foreground);
       assert (new_attr.color != COLOR_DEFAULT);
       if (stream->set_a_foreground != NULL)
-       tputs (tparm (stream->set_a_foreground, new_attr.color), 1, out_char);
+       tputs (tparm (stream->set_a_foreground, color_bgr (new_attr.color)),
+              1, out_char);
       else
-       tputs (tparm (stream->set_foreground, color_bgr (new_attr.color)),
+       tputs (tparm (stream->set_foreground, new_attr.color),
               1, out_char);
     }
   if (new_attr.bgcolor != old_attr.bgcolor)
@@ -339,9 +342,10 @@ out_attr_change (term_ostream_t stream,
       assert (stream->supports_background);
       assert (new_attr.bgcolor != COLOR_DEFAULT);
       if (stream->set_a_background != NULL)
-       tputs (tparm (stream->set_a_background, new_attr.bgcolor), 1, out_char);
+       tputs (tparm (stream->set_a_background, color_bgr (new_attr.bgcolor)),
+              1, out_char);
       else
-       tputs (tparm (stream->set_background, color_bgr (new_attr.bgcolor)),
+       tputs (tparm (stream->set_background, new_attr.bgcolor),
               1, out_char);
     }