From 1b613835dc3670978cc930612f5a55d5eff3fee6 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 24 Jun 2021 23:27:04 -0400 Subject: [PATCH] notcurses-info: color the braille --- src/info/main.c | 24 ++++++++++++++++++++---- src/lib/kitty.c | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/info/main.c b/src/info/main.c index a4de7cd76..6daa8b8c5 100644 --- a/src/info/main.c +++ b/src/info/main.c @@ -18,6 +18,18 @@ capbool(const tinfo* ti, bool cap){ return capboolbool(ti->caps.utf8, cap); } +static int +braille_viz(ncplane* n, const char* l, const wchar_t* egcs, const char* r, const char* indent){ + ncplane_set_fg_rgb(n, 0xfaf0e6); + ncplane_printf(n, "%s%s", indent, l); + ncplane_set_fg_rgb(n, 0xc4aead); + ncplane_printf(n, "%.192ls", egcs); + ncplane_set_fg_rgb(n, 0xfaf0e6); + ncplane_printf(n, "%s ", r); + ncplane_set_fg_default(n); + return 0; +} + static int unicodedumper(const struct notcurses* nc, struct ncplane* n, tinfo* ti, const char* indent){ ncplane_set_fg_rgb(n, 0x9172ec); @@ -51,10 +63,14 @@ unicodedumper(const struct notcurses* nc, struct ncplane* n, tinfo* ti, const ch NCBOXHEAVYW + 2, NCBOXHEAVYW + 5, NCBOXROUNDW + 2, NCBOXROUNDW + 5, NCBOXDOUBLEW + 2, NCBOXDOUBLEW + 5); - ncplane_printf(n, " ⎡%.192ls⎤ ⎨▐▌⎬ 🯸🯹\n", NCBRAILLEEGCS); - ncplane_printf(n, " ⎢%.192ls⎥ ⎪🮈▋⎪\n", NCBRAILLEEGCS + 64); - ncplane_printf(n, " ⎢%.192ls⎥ ⎪🮇▊⎪\n", NCBRAILLEEGCS + 128); - ncplane_printf(n, " ⎣%.192ls⎦ ⎪▕▉⎪\n", NCBRAILLEEGCS + 192); + braille_viz(n, "⎡", NCBRAILLEEGCS, "⎤", indent); + ncplane_printf(n, "⎨▐▌⎬ 🯸🯹\n"); + braille_viz(n, "⎢", NCBRAILLEEGCS + 64, "⎥", indent); + ncplane_printf(n, "⎪🮈▋⎪\n"); + braille_viz(n, "⎢", NCBRAILLEEGCS + 128, "⎥", indent); + ncplane_printf(n, "⎪🮇▊⎪\n"); + braille_viz(n, "⎣",NCBRAILLEEGCS + 192, "⎦", indent); + ncplane_printf(n, "⎪▕▉⎪\n"); ncplane_printf(n, " ⎛%ls⎞ ▔🭶🭷🭸🭹🭺🭻▁ 🭁 🭂 🭃 🭄 🭅 🭆 🭑 🭐 🭏 🭎 🭍 🭌 🭆🭑 🭄🭏 🭅🭐 🭃🭎 🭂🭍 🭁🭌 🭨🭪 ⎩ █⎭\n", NCEIGHTHSBOTTOM); ncplane_printf(n, " ⎝%ls⎠ ▏🭰🭱🭲🭳🭴🭵▕ 🭒 🭓 🭔 🭕 🭖 🭧 🭜 🭟 🭠 🭡 🭞 🭝 🭧🭜 🭕🭠 🭖🭡 🭔🭟 🭓🭞 🭒🭝 🭪🭨 \n", diff --git a/src/lib/kitty.c b/src/lib/kitty.c index a52831c9c..2704e255c 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -599,7 +599,7 @@ int kitty_destroy(const notcurses* nc __attribute__ ((unused)), // ideally, we wouldn't damage our annihilated sprixcells, but if // we're being annihilated only during this cycle, we need to go // ahead and damage it. - // r->s.damaged = 1; + r->s.damaged = 1; } }else{ // need this to damage cells underneath a sprixel we're removing