1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Support ESC[38;2;R;G;Bm for 24-bit true colour.

This is a heavily rewritten version of a patch originally by Lorenz
Diener; it was tidied up somewhat by Christian Brabandt, and then
tidied up more by me. The basic idea is to add to the termchar
structure a pair of small structs encoding 24-bit RGB values, each
with a flag indicating whether it's turned on; if it is, it overrides
any other specification of fg or bg colour for that character cell.

I've added a test line to colours.txt containing a few example colours
from /usr/share/X11/rgb.txt. In fact it makes quite a good demo to run
the whole of rgb.txt through this treatment, with a command such as

  perl -pe 's!^\s*(\d+)\s+(\d+)\s+(\d+).*$!\e[38;2;$1;$2;$3m$&\e[m!' rgb.txt
This commit is contained in:
Simon Tatham
2017-09-30 17:32:32 +01:00
parent 581dd7071e
commit a4cbd3dfdb
8 changed files with 204 additions and 34 deletions

View File

@ -45,7 +45,7 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len)
void request_resize(void *frontend, int x, int y) { }
void do_text(Context ctx, int x, int y, wchar_t * text, int len,
unsigned long attr, int lattr)
unsigned long attr, int lattr, truecolour tc)
{
int i;
@ -56,7 +56,7 @@ void do_text(Context ctx, int x, int y, wchar_t * text, int len,
printf("\n");
}
void do_cursor(Context ctx, int x, int y, wchar_t * text, int len,
unsigned long attr, int lattr)
unsigned long attr, int lattr, truecolour tc)
{
int i;