1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Still messing up with colors.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1972 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-04 21:47:37 +00:00 committed by cras
parent 5397b33d2d
commit d589ac85ce

View File

@ -101,30 +101,28 @@ static void textbuffer_cache_unref(TEXT_BUFFER_CACHE_REC *cache)
textbuffer_cache_destroy(cache);
}
#define FGATTR (ATTR_NOCOLORS | ATTR_RESETBG | ATTR_BLINK | 0xf0)
#define BGATTR (ATTR_NOCOLORS | ATTR_RESETFG | ATTR_BOLD | 0x0f)
#define FGATTR (ATTR_NOCOLORS | ATTR_RESETFG | ATTR_BOLD | 0x0f)
#define BGATTR (ATTR_NOCOLORS | ATTR_RESETBG | ATTR_BLINK | 0xf0)
static void update_cmd_color(unsigned char cmd, int *color)
{
if ((cmd & 0x80) == 0) {
if (cmd & LINE_COLOR_BG) {
/* set background color */
*color &= BGATTR;
if ((cmd & LINE_COLOR_DEFAULT) == 0) {
*color &= 0x70;
*color &= FGATTR;
if ((cmd & LINE_COLOR_DEFAULT) == 0)
*color |= (cmd & 0x0f) << 4;
} else {
else {
*color |= ATTR_RESETBG;
if (cmd & LINE_COLOR_BLINK)
*color |= ATTR_BLINK;
}
} else {
/* set foreground color */
*color &= FGATTR;
if ((cmd & LINE_COLOR_DEFAULT) == 0) {
*color &= 0x0f;
*color &= BGATTR;
if ((cmd & LINE_COLOR_DEFAULT) == 0)
*color |= cmd & 0x0f;
} else {
else {
*color |= ATTR_RESETFG;
if (cmd & LINE_COLOR_BOLD)
*color |= ATTR_BOLD;