summaryrefslogtreecommitdiff
path: root/lisp/term/xterm.el
diff options
context:
space:
mode:
authorRami Ylimäki <rami.ylimaki@vincit.fi>2017-02-18 13:04:55 +0200
committerEli Zaretskii <eliz@gnu.org>2017-02-18 13:04:55 +0200
commite463e5762bbe628be3d15da066a90f079a8468b3 (patch)
tree2aa517f3626acbe0dbc73dc7ad5a8ec7d81656c9 /lisp/term/xterm.el
parent464a51ed46990554bed8a9443168c976d6c3c6d3 (diff)
downloademacs-e463e5762bbe628be3d15da066a90f079a8468b3.tar.gz
Support 24-bit direct colors on text terminals
* src/term.c (init_tty): Use 24-bit terminal colors if corresponding foreground and background functions are present in terminal type definition. * src/tparam.h: Define prototype for tigetstr. * lisp/term/tty-colors.el (tty-color-define): Convert color palette index to pixel value on 16.7M color terminals. (tty-color-24bit): New function to convert color palette index to pixel value on 16.7M color terminals. (tty-color-desc): Don't approximate colors on 16.7M color terminals. * lisp/term/xterm.el (xterm-register-default-colors): Define all named TTY colors on 16.7M color terminals. * doc/misc/efaq.texi (Colors on a TTY): Add instructions on how to enable direct color TTY mode. * etc/NEWS: Mention direct color TTY mode and point to FAQ.
Diffstat (limited to 'lisp/term/xterm.el')
-rw-r--r--lisp/term/xterm.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 339d05d9728..e6d224dd3de 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -930,6 +930,14 @@ versions of xterm."
;; are more colors to support, compute them now.
(when (> ncolors 0)
(cond
+ ((= ncolors 16777200) ; 24-bit xterm
+ ;; all named tty colors
+ (let ((idx (length xterm-standard-colors)))
+ (mapc (lambda (color)
+ (unless (assoc (car color) xterm-standard-colors)
+ (tty-color-define (car color) idx (cdr color))
+ (setq idx (1+ idx))))
+ color-name-rgb-alist)))
((= ncolors 240) ; 256-color xterm
;; 216 non-gray colors first
(let ((r 0) (g 0) (b 0))