mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
terminfo_max_colors()
This commit is contained in:
parent
d8e749c0f4
commit
99058d53d7
@ -530,6 +530,31 @@ set_screen_driver_opt(struct screen_driver *driver, struct option *term_spec)
|
||||
} /* !utf8_io */
|
||||
#ifdef CONFIG_TERMINFO
|
||||
driver->opt.terminfo = get_cmd_opt_bool("terminfo");
|
||||
switch (terminfo_max_colors()) {
|
||||
case 88:
|
||||
#ifdef CONFIG_88_COLORS
|
||||
driver->opt.color_mode = COLOR_MODE_88;
|
||||
#else
|
||||
driver->opt.color_mode = COLOR_MODE_16;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 256:
|
||||
#ifdef CONFIG_256_COLORS
|
||||
driver->opt.color_mode = COLOR_MODE_256;
|
||||
#else
|
||||
driver->opt.color_mode = COLOR_MODE_16;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 16:
|
||||
case 8:
|
||||
driver->opt.color_mode = COLOR_MODE_16;
|
||||
break;
|
||||
default:
|
||||
driver->opt.color_mode = COLOR_MODE_MONO;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -60,3 +60,9 @@ terminfo_set_foreground(int arg)
|
||||
{
|
||||
return tiparm(set_a_foreground, arg);
|
||||
}
|
||||
|
||||
int
|
||||
terminfo_max_colors(void)
|
||||
{
|
||||
return max_colors;
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ char *terminfo_set_italics(int arg);
|
||||
char *terminfo_set_underline(int arg);
|
||||
char *terminfo_set_foreground(int arg);
|
||||
char *terminfo_set_background(int arg);
|
||||
|
||||
int terminfo_max_colors(void);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user