diff options
| author | Rami Ylimäki | 2017-02-18 13:04:55 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-02-18 13:04:55 +0200 |
| commit | e463e5762bbe628be3d15da066a90f079a8468b3 (patch) | |
| tree | 2aa517f3626acbe0dbc73dc7ad5a8ec7d81656c9 /src/term.c | |
| parent | 464a51ed46990554bed8a9443168c976d6c3c6d3 (diff) | |
| download | emacs-e463e5762bbe628be3d15da066a90f079a8468b3.tar.gz emacs-e463e5762bbe628be3d15da066a90f079a8468b3.zip | |
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 'src/term.c')
| -rw-r--r-- | src/term.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c index b0ff9cb546d..35fa8c931c1 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -4131,6 +4131,20 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ | |||
| 4131 | 4131 | ||
| 4132 | tty->TN_max_colors = tgetnum ("Co"); | 4132 | tty->TN_max_colors = tgetnum ("Co"); |
| 4133 | 4133 | ||
| 4134 | #ifdef TERMINFO | ||
| 4135 | /* Non-standard support for 24-bit colors. */ | ||
| 4136 | { | ||
| 4137 | const char* fg = tigetstr ("setf24"); | ||
| 4138 | const char* bg = tigetstr ("setb24"); | ||
| 4139 | if (fg && bg && fg != (char *)-1 && bg != (char *)-1) | ||
| 4140 | { | ||
| 4141 | tty->TS_set_foreground = fg; | ||
| 4142 | tty->TS_set_background = bg; | ||
| 4143 | tty->TN_max_colors = 16777216; | ||
| 4144 | } | ||
| 4145 | } | ||
| 4146 | #endif | ||
| 4147 | |||
| 4134 | tty->TN_no_color_video = tgetnum ("NC"); | 4148 | tty->TN_no_color_video = tgetnum ("NC"); |
| 4135 | if (tty->TN_no_color_video == -1) | 4149 | if (tty->TN_no_color_video == -1) |
| 4136 | tty->TN_no_color_video = 0; | 4150 | tty->TN_no_color_video = 0; |