diff options
-rw-r--r-- | src/vppinfra/format_table.c | 14 | ||||
-rw-r--r-- | src/vppinfra/format_table.h | 8 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/vppinfra/format_table.c b/src/vppinfra/format_table.c index 8b218f5f2e1..5fe7521af86 100644 --- a/src/vppinfra/format_table.c +++ b/src/vppinfra/format_table.c @@ -64,12 +64,14 @@ format_text_cell (table_t *t, u8 *s, table_cell_t *c, table_text_attr_t *def, { a->fg_color = c->attr.fg_color; a->flags |= TTAF_FG_COLOR_SET; + a->flags |= c->attr.flags & TTAF_FG_COLOR_BRIGHT; } if (c->attr.flags & TTAF_BG_COLOR_SET) { a->bg_color = c->attr.bg_color; a->flags |= TTAF_BG_COLOR_SET; + a->flags |= c->attr.flags & TTAF_BG_COLOR_BRIGHT; } if (a->flags & TTAF_RESET) @@ -216,16 +218,24 @@ void table_set_cell_fg_color (table_t *t, int c, int r, table_text_attr_color_t v) { table_cell_t *cell = table_get_cell (t, c, r); - cell->attr.fg_color = v; + cell->attr.fg_color = v & 0x7; cell->attr.flags |= TTAF_FG_COLOR_SET; + if (v & 8) + cell->attr.flags |= TTAF_FG_COLOR_BRIGHT; + else + cell->attr.flags &= ~TTAF_FG_COLOR_BRIGHT; } void table_set_cell_bg_color (table_t *t, int c, int r, table_text_attr_color_t v) { table_cell_t *cell = table_get_cell (t, c, r); - cell->attr.bg_color = v; + cell->attr.bg_color = v & 0x7; cell->attr.flags |= TTAF_BG_COLOR_SET; + if (v & 8) + cell->attr.flags |= TTAF_BG_COLOR_BRIGHT; + else + cell->attr.flags &= ~TTAF_BG_COLOR_BRIGHT; } void diff --git a/src/vppinfra/format_table.h b/src/vppinfra/format_table.h index a6595333e0b..4f4a7724b0e 100644 --- a/src/vppinfra/format_table.h +++ b/src/vppinfra/format_table.h @@ -46,6 +46,14 @@ typedef enum TTAC_MAGENTA = 5, TTAC_CYAN = 6, TTAC_WHITE = 7, + TTAC_BRIGHT_BLACK = 8, + TTAC_BRIGHT_RED = 9, + TTAC_BRIGHT_GREEN = 10, + TTAC_BRIGHT_YELLOW = 11, + TTAC_BRIGHT_BLUE = 12, + TTAC_BRIGHT_MAGENTA = 13, + TTAC_BRIGHT_CYAN = 14, + TTAC_BRIGHT_WHITE = 15, } table_text_attr_color_t; typedef enum |