diff --git a/src/demo/widecolor.c b/src/demo/widecolor.c index dea6c348d..c1b30fe47 100644 --- a/src/demo/widecolor.c +++ b/src/demo/widecolor.c @@ -8,12 +8,12 @@ static int message(struct ncplane* n, int maxy, int maxx, int num, int total){ + uint64_t channels = 0; + notcurses_fg_prep(&channels, 255, 255, 255); ncplane_bg_default(n); ncplane_cursor_move_yx(n, 3, 1); - ncplane_fg_rgb8(n, 0, 0, 0); - ncplane_bg_rgb8(n, 255, 255, 255); ncplane_styles_on(n, CELL_STYLE_BOLD); - if(ncplane_rounded_box(n, 0, 0, 5, 57, 0)){ + if(ncplane_rounded_box(n, 0, channels, 5, 57, 0)){ return -1; } ncplane_cursor_move_yx(n, 3, 4); @@ -23,7 +23,7 @@ message(struct ncplane* n, int maxy, int maxx, int num, int total){ ncplane_cursor_move_yx(n, 1, 4); ncplane_putegc(n, "╔", 0, 0, NULL); cell hl = CELL_TRIVIAL_INITIALIZER; - cell_load(n, &hl, "═"); + cell_prime(n, &hl, "═", 0, channels); ncplane_hline(n, &hl, 15); cell_release(n, &hl); ncplane_cursor_move_yx(n, 1, 20); diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 1b921a168..fa7581670 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1542,21 +1542,33 @@ int ncplane_box(ncplane* n, const cell* ul, const cell* ur, } ++yoff; // middle rows (vertical lines) - if(yoff < ystop - 1){ + if(yoff < ystop){ if(!(ctlword & NCBOXMASK_LEFT)){ if(ncplane_cursor_move_yx(n, yoff, xoff)){ return -1; } - if(ncplane_vline_interp(n, vl, ystop - yoff + 1, ul->channels, ll->channels) < 0){ - return -1; + if((ctlword & (NCBOXGRAD_LEFT << 4u))){ // grad styling, ul->ll + if(ncplane_vline_interp(n, vl, ystop - yoff + 1, ul->channels, ll->channels) < 0){ + return -1; + } + }else{ + if(ncplane_vline(n, vl, ystop - yoff + 1) < 0){ + return -1; + } } } if(!(ctlword & NCBOXMASK_RIGHT)){ if(ncplane_cursor_move_yx(n, yoff, xstop)){ return -1; } - if(ncplane_vline_interp(n, vl, ystop - yoff + 1, ur->channels, lr->channels) < 0){ - return -1; + if((ctlword & (NCBOXGRAD_RIGHT << 4u))){ // grad styling, ur->lr + if(ncplane_vline_interp(n, vl, ystop - yoff + 1, ur->channels, lr->channels) < 0){ + return -1; + } + }else{ + if(ncplane_vline(n, vl, ystop - yoff + 1) < 0){ + return -1; + } } } }