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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user