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.

Fixes: debbugs:14078
This commit is contained in:
oblique 2013-12-18 00:03:23 +08:00 committed by Chong Yidong
parent 9718dea2e1
commit ed3af8a771
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2013-12-17 oblique <psyberbits@gmail.com> (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 <dima@secretsauce.net> (tiny change)
* simple.el (kill-region): Pass mark first, then point, so that

View file

@ -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 @@ 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)