1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 21:12:47 -05:00

Fix 256-colours-match-xterm, based on 256colres.pl from xterm-205.

Largely untested -- may not even compile on Windows.

[originally from svn r6393]
This commit is contained in:
Ben Harris
2005-10-13 21:56:43 +00:00
parent 8fb9bd0216
commit 9d31462c52
3 changed files with 11 additions and 10 deletions

View File

@ -1407,12 +1407,12 @@ void palette_reset(void *frontend)
for (i = 0; i < NEXTCOLOURS; i++) {
if (i < 216) {
int r = i / 36, g = (i / 6) % 6, b = i % 6;
inst->cols[i+16].red = r * 0x3333;
inst->cols[i+16].green = g * 0x3333;
inst->cols[i+16].blue = b * 0x3333;
inst->cols[i+16].red = r ? r * 0x2828 + 0x3737 : 0;
inst->cols[i+16].green = g ? g * 0x2828 + 0x3737 : 0;
inst->cols[i+16].blue = b ? b + 0x2828 + 0x3737 : 0;
} else {
int shade = i - 216;
shade = (shade + 1) * 0xFFFF / (NEXTCOLOURS - 216 + 1);
shade = shade * 0x0a0a + 0x0808;
inst->cols[i+16].red = inst->cols[i+16].green =
inst->cols[i+16].blue = shade;
}