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

Support SGR 2 to dim the foreground colour.

I've done this on a 'where possible' basis: in Windows paletted mode
(in case anyone is still using an old enough graphics card to need
that!) I simply haven't bothered, and will completely ignore the dim
flag.
This commit is contained in:
Simon Tatham
2017-10-05 21:02:56 +01:00
parent 4743798400
commit 1a718403d4
4 changed files with 67 additions and 29 deletions

View File

@ -3440,7 +3440,7 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
if ((attr & TATTR_ACTCURS) && (cursor_type == 0 || term->big_cursor)) {
truecolour.fg = truecolour.bg = optionalrgb_none;
attr &= ~(ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS);
attr &= ~(ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS|ATTR_DIM);
/* cursor fg and bg */
attr |= (260 << ATTR_FGSHIFT) | (261 << ATTR_BGSHIFT);
is_cursor = TRUE;
@ -3543,6 +3543,12 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
else
bg = colours[nbg];
if (!pal && (attr & ATTR_DIM)) {
fg = RGB(GetRValue(fg) * 2 / 3,
GetGValue(fg) * 2 / 3,
GetBValue(fg) * 2 / 3);
}
SelectObject(hdc, fonts[nfont]);
SetTextColor(hdc, fg);
SetBkColor(hdc, bg);