emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115568: Fix 256 color mapping in rxvt.el


From: Chong Yidong
Subject: [Emacs-diffs] trunk r115568: Fix 256 color mapping in rxvt.el
Date: Tue, 17 Dec 2013 16:03:28 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115568
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14078
author: oblique <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2013-12-18 00:03:23 +0800
message:
  Fix 256 color mapping in rxvt.el
  
  * term/rxvt.el (rxvt-rgb-convert-to-16bit): Standardize with
  xterm-rgb-convert-to-16bit.
  (rxvt-register-default-colors): Standardize with
  xterm-register-default-colors.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/term/rxvt.el              rxvt.el-20091113204419-o5vbwnq5f7feedwu-2376
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-17 15:48:26 +0000
+++ b/lisp/ChangeLog    2013-12-17 16:03:23 +0000
@@ -1,3 +1,10 @@
+2013-12-17  oblique  <address@hidden>  (tiny change)
+
+       * term/rxvt.el (rxvt-rgb-convert-to-16bit): Standardize with
+       xterm-rgb-convert-to-16bit.
+       (rxvt-register-default-colors): Standardize with
+       xterm-register-default-colors (Bug#14078).
+
 2013-12-17  Dima Kogan  <address@hidden>  (tiny change)
 
        * simple.el (kill-region): Pass mark first, then point, so that

=== modified file 'lisp/term/rxvt.el'
--- a/lisp/term/rxvt.el 2013-01-01 09:11:05 +0000
+++ b/lisp/term/rxvt.el 2013-12-17 16:03:23 +0000
@@ -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,9 @@
            (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]