]> code.delx.au - gnu-emacs/blobdiff - lisp/term/rxvt.el
Update copyright year to 2015
[gnu-emacs] / lisp / term / rxvt.el
index 981415630069ad426dcdabb23a60612356abc9f5..fa981c6625bdc4734228c7110bf79d9d831439c0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; rxvt.el --- define function key sequences and standard colors for rxvt
 
-;; Copyright (C) 2002-201 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii
 ;; Keywords: terminals
 
 (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)