aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2005-04-09 15:25:50 +0000
committerDan Nicolaescu2005-04-09 15:25:50 +0000
commitce102cb1e3feeb1e490c732e4aa49401f9647f70 (patch)
treeb657ff4dc0d1b18ddb0897f99576be78c3ca1f31
parent1cf21850176ab21c115d148d0f8e95209898e4b7 (diff)
downloademacs-ce102cb1e3feeb1e490c732e4aa49401f9647f70.tar.gz
emacs-ce102cb1e3feeb1e490c732e4aa49401f9647f70.zip
(xterm-rgb-convert-to-16bit): Simplify.
(xterm-register-default-colors): Update color values computation to match xterm-200.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/term/xterm.el11
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d569e9a0163..5f6731885d9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12005-04-09 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * term/xterm.el (xterm-rgb-convert-to-16bit): Simplify.
4 (xterm-register-default-colors): Update color values computation
5 to match xterm-200.
6
12005-04-09 Kenichi Handa <handa@m17n.org> 72005-04-09 Kenichi Handa <handa@m17n.org>
2 8
3 * international/code-pages.el (iso-latin-7): Fix the map. 9 * international/code-pages.el (iso-latin-7): Fix the map.
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 44688e82b6d..b62f6efd478 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -123,7 +123,7 @@
123 123
124(defun xterm-rgb-convert-to-16bit (prim) 124(defun xterm-rgb-convert-to-16bit (prim)
125 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value." 125 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
126 (min 65535 (round (* (/ prim 255.0) 65535.0)))) 126 (logior prim (lsh prim 8)))
127 127
128(defun xterm-register-default-colors () 128(defun xterm-register-default-colors ()
129 "Register the default set of colors for xterm or compatible emulator. 129 "Register the default set of colors for xterm or compatible emulator.
@@ -160,9 +160,10 @@ versions of xterm."
160 (tty-color-define (format "color-%d" (- 256 ncolors)) 160 (tty-color-define (format "color-%d" (- 256 ncolors))
161 (- 256 ncolors) 161 (- 256 ncolors)
162 (mapcar 'xterm-rgb-convert-to-16bit 162 (mapcar 'xterm-rgb-convert-to-16bit
163 (list (round (* r 42.5)) 163 (list (if (zerop r) 0 (+ (* r 40) 55))
164 (round (* g 42.5)) 164 (if (zerop g) 0 (+ (* g 40) 55))
165 (round (* b 42.5))))) 165 (if (zerop b) 0 (+ (* b 40) 55)))))
166
166 (setq b (1+ b)) 167 (setq b (1+ b))
167 (if (> b 5) 168 (if (> b 5)
168 (setq g (1+ g) 169 (setq g (1+ g)
@@ -200,7 +201,7 @@ versions of xterm."
200 ;; Now the 8 gray colors 201 ;; Now the 8 gray colors
201 (while (> ncolors 0) 202 (while (> ncolors 0)
202 (setq color (xterm-rgb-convert-to-16bit 203 (setq color (xterm-rgb-convert-to-16bit
203 (round 204 (floor
204 (if (= ncolors 8) 205 (if (= ncolors 8)
205 46.36363636 206 46.36363636
206 (+ (* (- 8 ncolors) 23.18181818) 69.54545454))))) 207 (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))