ncplane_set_*_palindex(): just use ncchannels*() #2049

This commit is contained in:
nick black 2021-08-12 01:08:21 -04:00
parent 6967723e53
commit 7108dc36c0
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 5 additions and 18 deletions

View File

@ -1,6 +1,9 @@
This document attempts to list user-visible changes and any major internal
rearrangements of Notcurses.
* 2.3.14 (not yet released)
* Fixed grotesque errors in `ncplane_set_*_palindex()`.
* 2.3.13 (2021-08-04)
* Added the portable utility functions `notcurses_accountname()` and
`notcurses_hostname()`.

View File

@ -1378,27 +1378,11 @@ int ncplane_set_bg_alpha(ncplane *n, int alpha){
}
int ncplane_set_fg_palindex(ncplane* n, int idx){
if(idx < 0 || idx >= NCPALETTESIZE){
return -1;
}
n->channels |= NC_FGDEFAULT_MASK;
n->channels |= NC_FG_PALETTE;
ncchannels_set_fg_alpha(&n->channels, NCALPHA_OPAQUE);
n->stylemask &= 0xffff00ff;
n->stylemask |= (idx << 8u);
return 0;
return ncchannels_set_fg_palindex(&n->channels, idx);
}
int ncplane_set_bg_palindex(ncplane* n, int idx){
if(idx < 0 || idx >= NCPALETTESIZE){
return -1;
}
n->channels |= NC_BGDEFAULT_MASK;
n->channels |= NC_BG_PALETTE;
ncchannels_set_bg_alpha(&n->channels, NCALPHA_OPAQUE);
n->stylemask &= 0xffffff00;
n->stylemask |= idx;
return 0;
return ncchannels_set_bg_palindex(&n->channels, idx);
}
int ncplane_set_base_cell(ncplane* ncp, const nccell* c){