diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-04 19:20:09 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-04 19:20:09 +0000 |
commit | 59d46dcadf2646dc568ae7085e4a3e0d899d59f9 (patch) | |
tree | f25445888de6b83d404f5255115e505c10c8c700 /src/fe-text | |
parent | 93c0086d411a4ddec854755584f838344a54dae5 (diff) | |
download | irssi-59d46dcadf2646dc568ae7085e4a3e0d899d59f9.zip |
MIRC colors >=16 changed to work as in MIRC (color %= 16)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1066 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/gui-printtext.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index 460cc9a8..a9feda4c 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -33,7 +33,7 @@ #define TEXT_CHUNK_USABLE_SIZE (LINE_TEXT_CHUNK_SIZE-2-(int)sizeof(char*)) -int mirc_colors[] = { 15, 0, 1, 2, 12, 6, 5, 4, 14, 10, 3, 11, 9, 13, 8, 7, 15 }; +int mirc_colors[] = { 15, 0, 1, 2, 12, 6, 5, 4, 14, 10, 3, 11, 9, 13, 8, 7 }; static int scrollback_lines, scrollback_hours; static int scrollback_save_formats; @@ -247,10 +247,11 @@ static void remove_old_lines(WINDOW_REC *window) static void get_colors(int flags, int *fg, int *bg) { if (flags & PRINTFLAG_MIRC_COLOR) { - /* mirc colors */ - *fg = *fg < 0 || *fg > 16 ? - /*current_theme->default_color*/0 : mirc_colors[*fg]; - *bg = *bg < 0 || *bg > 16 ? 0 : mirc_colors[*bg]; + /* mirc colors - real range is 0..15, but after 16 + colors wrap to 0, 1, ... */ + *fg = *fg < 0 ? + /*current_theme->default_color*/0 : mirc_colors[*fg % 16]; + *bg = *bg < 0 ? 0 : mirc_colors[*bg % 16]; } else { /* default colors */ *fg = *fg < 0 || *fg > 15 ? |