uniblock: darken the area above the block

pull/278/head
nick black 5 years ago
parent 631c684a88
commit c8f12b6412
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -3,7 +3,8 @@ blingful TUI library for modern terminal emulators. definitely not curses.
by [nick black](https://nick-black.com/dankwiki/index.php/Hack_on) (<nickblack@linux.com>)
for more information, see [my wiki](https://nick-black.com/dankwiki/index.php/Notcurses).
for more information, see [my wiki](https://nick-black.com/dankwiki/index.php/Notcurses)
and the [man pages](https://nick-black.com/notcurses).
<p align="center">
<img width="640" height="242" src="doc/0.4.0-sheet.png" alt="notcurses 0.4.0 contact sheet"/>

@ -163,12 +163,22 @@ int unicodeblocks_demo(struct notcurses* nc){
struct timespec subdelay;
uint64_t nstotal = timespec_to_ns(&demodelay);
ns_to_timespec(nstotal / 3, &subdelay);
struct ncplane* header = ncplane_aligned(notcurses_stdplane(nc), 2,
(CHUNKSIZE * 2) - 2, 1,
NCALIGN_CENTER, NULL);
if(header == NULL){
return -1;
}
cell c = CELL_TRIVIAL_INITIALIZER;
cell_set_fg_alpha(&c, CELL_ALPHA_BLEND);
cell_set_fg(&c, 0x004000);
ncplane_set_base(header, &c);
for(sindex = 0 ; sindex < sizeof(blocks) / sizeof(*blocks) ; ++sindex){
ncplane_set_bg_rgb(n, 0, 0, 0);
uint32_t blockstart = blocks[sindex].start;
const char* description = blocks[sindex].name;
ncplane_set_fg_rgb(n, 0xad, 0xd8, 0xe6);
if(ncplane_printf_aligned(n, 1, NCALIGN_CENTER, "Unicode points %05x%05x", blockstart, blockstart + BLOCKSIZE) <= 0){
ncplane_set_fg_rgb(header, 0xbd, 0xe8, 0xf6);
if(ncplane_printf_aligned(header, 1, NCALIGN_CENTER, "Unicode points %05x%05x", blockstart, blockstart + BLOCKSIZE) <= 0){
return -1;
}
struct ncplane* nn;
@ -199,5 +209,6 @@ int unicodeblocks_demo(struct notcurses* nc){
// really, the vast majority of space is unused.
blockstart += BLOCKSIZE;
}
ncplane_destroy(header);
return 0;
}

@ -454,7 +454,7 @@ int witherworm_demo(struct notcurses* nc){
cell c;
struct timespec screenend;
clock_gettime(CLOCK_MONOTONIC, &screenend);
ns_to_timespec(timespec_to_ns(&screenend) + 4 * timespec_to_ns(&demodelay), &screenend);
ns_to_timespec(timespec_to_ns(&screenend) + 2 * timespec_to_ns(&demodelay), &screenend);
do{ // (re)draw a screen
const int start = starts[i];
int step = steps[i];

Loading…
Cancel
Save