diff --git a/src/lib/internal.h b/src/lib/internal.h index 3232c8f14..d73b6e270 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -1206,6 +1206,9 @@ int sixel_blit(ncplane* nc, int placey, int placex, int linesize, const void* data, int begy, int begx, int leny, int lenx, unsigned cellpixx); +int term_fg_rgb8(bool RGBflag, const char* setaf, int colors, FILE* out, + unsigned r, unsigned g, unsigned b); + typedef struct ncvisual_implementation { int (*visual_init)(int loglevel); void (*visual_printbanner)(const struct notcurses* nc); diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 58c15a106..0dbd787f1 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -825,18 +825,28 @@ init_banner(const notcurses* nc){ printf("\n notcurses %s by nick black et al", notcurses_version()); term_fg_palindex(nc, stdout, nc->tcache.colors <= 256 ? 12 % nc->tcache.colors : 0x2080e0); if(nc->tcache.cellpixy && nc->tcache.cellpixx){ - printf("\n %d rows (%dpx) %d cols (%dpx) (%sB) %zuB cells %d colors%s\n", + printf("\n %d rows (%dpx) %d cols (%dpx) (%sB) %zuB cells %d colors", nc->stdplane->leny, nc->tcache.cellpixy, nc->stdplane->lenx, nc->tcache.cellpixx, bprefix(nc->stats.fbbytes, 1, prefixbuf, 0), sizeof(nccell), - nc->tcache.colors, nc->tcache.RGBflag ? "+RGB" : ""); + nc->tcache.colors); }else{ - printf("\n %d rows %d cols (%sB) %zuB cells %d colors%s\n", + printf("\n %d rows %d cols (%sB) %zuB cells %d colors", nc->stdplane->leny, nc->stdplane->lenx, bprefix(nc->stats.fbbytes, 1, prefixbuf, 0), sizeof(nccell), - nc->tcache.colors, nc->tcache.RGBflag ? "+RGB" : ""); - } - printf(" compiled with gcc-%s, %s-endian\n" + nc->tcache.colors); + } + if(nc->tcache.RGBflag){ + putc('+', stdout); + term_fg_rgb8(true, nc->tcache.setaf, nc->tcache.colors, stdout, 0xc0, 0x80, 0x80); + putc('R', stdout); + term_fg_rgb8(true, nc->tcache.setaf, nc->tcache.colors, stdout, 0x80, 0xc0, 0x80); + putc('G', stdout); + term_fg_rgb8(true, nc->tcache.setaf, nc->tcache.colors, stdout, 0x80, 0x80, 0xc0); + putc('B', stdout); + term_fg_palindex(nc, stdout, nc->tcache.colors <= 256 ? 12 % nc->tcache.colors : 0x2080e0); + } + printf("\n compiled with gcc-%s, %s-endian\n" " terminfo from %s\n", __VERSION__, #ifdef __BYTE_ORDER__ diff --git a/src/lib/render.c b/src/lib/render.c index ae02bd438..a96ce0c8c 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -774,9 +774,8 @@ term_bg_rgb8(bool RGBflag, const char* setab, int colors, FILE* out, return 0; } -static inline int -term_fg_rgb8(bool RGBflag, const char* setaf, int colors, FILE* out, - unsigned r, unsigned g, unsigned b){ +int term_fg_rgb8(bool RGBflag, const char* setaf, int colors, FILE* out, + unsigned r, unsigned g, unsigned b){ // We typically want to use tputs() and tiperm() to acquire and write the // escapes, as these take into account terminal-specific delays, padding, // etc. For the case of DirectColor, there is no suitable terminfo entry, but