GNU bug report logs - #14078
[PATCH] Fix 256 color mapping in rxvt.el

Previous Next

Package: emacs;

Reported by: oblique <psyberbits <at> gmail.com>

Date: Thu, 28 Mar 2013 20:08:02 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: oblique <psyberbits <at> gmail.com>
Subject: bug#14078: closed (Re: bug#14078: [PATCH] Fix 256 color mapping
 in rxvt.el)
Date: Tue, 17 Dec 2013 16:05:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#14078: [PATCH] Fix 256 color mapping in rxvt.el

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 14078 <at> debbugs.gnu.org.

-- 
14078: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14078
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Chong Yidong <cyd <at> gnu.org>
To: oblique <psyberbits <at> gmail.com>
Cc: 14078-done <at> debbugs.gnu.org
Subject: Re: bug#14078: [PATCH] Fix 256 color mapping in rxvt.el
Date: Wed, 18 Dec 2013 00:04:16 +0800
oblique <psyberbits <at> gmail.com> writes:

> Color mapping was wrong, I use the same way xterm.el does it.

Thanks, committed to trunk.

[Message part 3 (message/rfc822, inline)]
From: oblique <psyberbits <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: oblique <psyberbits <at> gmail.com>
Subject: [PATCH] Fix 256 color mapping in rxvt.el
Date: Thu, 28 Mar 2013 22:02:43 +0200
Color mapping was wrong, I use the same way xterm.el does it.
---
 lisp/term/rxvt.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 0e026a8..6a62cff 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -201,7 +201,7 @@
 
 (defun rxvt-rgb-convert-to-16bit (prim)
   "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
-  (min 65535 (round (* (/ prim 255.0) 65535.0))))
+  (logior prim (lsh prim 8)))
 
 (defun rxvt-register-default-colors ()
   "Register the default set of colors for rxvt or compatible emulator.
@@ -233,9 +233,10 @@ for the currently selected frame."
 	    (tty-color-define (format "color-%d" (- 256 ncolors))
 			      (- 256 ncolors)
 			      (mapcar 'rxvt-rgb-convert-to-16bit
-				      (list (round (* r 42.5))
-					    (round (* g 42.5))
-					    (round (* b 42.5)))))
+                                      (list (if (zerop r) 0 (+ (* r 40) 55))
+                                            (if (zerop g) 0 (+ (* g 40) 55))
+                                            (if (zerop b) 0 (+ (* b 40) 55)))))
+
 	    (setq b (1+ b))
 	    (if (> b 5)
 		(setq g (1+ g)
-- 
1.8.1.5




This bug report was last modified 11 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.