Use constant for describe color intensity
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
родитель
26b0623e87
Коммит
3def2733dd
@ -38,6 +38,8 @@ gboolean mc_tty_color_disable;
|
|||||||
|
|
||||||
/*** file scope macro definitions ****************************************************************/
|
/*** file scope macro definitions ****************************************************************/
|
||||||
|
|
||||||
|
#define COLOR_INTENSITY 8
|
||||||
|
|
||||||
/*** file scope type declarations ****************************************************************/
|
/*** file scope type declarations ****************************************************************/
|
||||||
|
|
||||||
typedef struct mc_tty_color_table_struct
|
typedef struct mc_tty_color_table_struct
|
||||||
@ -50,21 +52,21 @@ typedef struct mc_tty_color_table_struct
|
|||||||
|
|
||||||
mc_tty_color_table_t const color_table[] = {
|
mc_tty_color_table_t const color_table[] = {
|
||||||
{"black", COLOR_BLACK},
|
{"black", COLOR_BLACK},
|
||||||
{"gray", COLOR_BLACK + 8},
|
{"gray", COLOR_BLACK + COLOR_INTENSITY},
|
||||||
{"red", COLOR_RED},
|
{"red", COLOR_RED},
|
||||||
{"brightred", COLOR_RED + 8},
|
{"brightred", COLOR_RED + COLOR_INTENSITY},
|
||||||
{"green", COLOR_GREEN},
|
{"green", COLOR_GREEN},
|
||||||
{"brightgreen", COLOR_GREEN + 8},
|
{"brightgreen", COLOR_GREEN + COLOR_INTENSITY},
|
||||||
{"brown", COLOR_YELLOW},
|
{"brown", COLOR_YELLOW},
|
||||||
{"yellow", COLOR_YELLOW + 8},
|
{"yellow", COLOR_YELLOW + COLOR_INTENSITY},
|
||||||
{"blue", COLOR_BLUE},
|
{"blue", COLOR_BLUE},
|
||||||
{"brightblue", COLOR_BLUE + 8},
|
{"brightblue", COLOR_BLUE + COLOR_INTENSITY},
|
||||||
{"magenta", COLOR_MAGENTA},
|
{"magenta", COLOR_MAGENTA},
|
||||||
{"brightmagenta", COLOR_MAGENTA + 8},
|
{"brightmagenta", COLOR_MAGENTA + COLOR_INTENSITY},
|
||||||
{"cyan", COLOR_CYAN},
|
{"cyan", COLOR_CYAN},
|
||||||
{"brightcyan", COLOR_CYAN + 8},
|
{"brightcyan", COLOR_CYAN + COLOR_INTENSITY},
|
||||||
{"lightgray", COLOR_WHITE},
|
{"lightgray", COLOR_WHITE},
|
||||||
{"white", COLOR_WHITE + 8},
|
{"white", COLOR_WHITE + COLOR_INTENSITY},
|
||||||
{"default", -1}, /* default color of the terminal */
|
{"default", -1}, /* default color of the terminal */
|
||||||
/* special colors */
|
/* special colors */
|
||||||
{"A_REVERSE", SPEC_A_REVERSE},
|
{"A_REVERSE", SPEC_A_REVERSE},
|
||||||
|
@ -169,8 +169,8 @@ tty_color_try_alloc_pair_lib (tty_color_pair_t * mc_color_pair)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fg = tty_color_get_name_by_index(mc_color_pair->ifg);
|
fg = tty_color_get_name_by_index (mc_color_pair->ifg);
|
||||||
bg = tty_color_get_name_by_index(mc_color_pair->ibg);
|
bg = tty_color_get_name_by_index (mc_color_pair->ibg);
|
||||||
SLtt_set_color (mc_color_pair->pair_index, (char *) "", (char *) fg, (char *) bg);
|
SLtt_set_color (mc_color_pair->pair_index, (char *) "", (char *) fg, (char *) bg);
|
||||||
SLtt_add_color_attribute (mc_color_pair->pair_index, mc_color_pair->attr);
|
SLtt_add_color_attribute (mc_color_pair->pair_index, mc_color_pair->attr);
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ tty_set_normal_attrs (void)
|
|||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
tty_use_256colors(void)
|
tty_use_256colors (void)
|
||||||
{
|
{
|
||||||
return (SLtt_Use_Ansi_Colors && SLtt_tgetnum ((char *) "Co") == 256);
|
return (SLtt_Use_Ansi_Colors && SLtt_tgetnum ((char *) "Co") == 256);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
|
|
||||||
#include "tty-internal.h" /* slow_tty */
|
#include "tty-internal.h" /* slow_tty */
|
||||||
#include "tty.h"
|
#include "tty.h"
|
||||||
|
#include "color.h"
|
||||||
#include "color-slang.h"
|
#include "color-slang.h"
|
||||||
#include "color-internal.h"
|
#include "color-internal.h"
|
||||||
#include "mouse.h" /* Gpm_Event is required in key.h */
|
#include "mouse.h" /* Gpm_Event is required in key.h */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user