mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
ncplane_set_*_palindex(): just use ncchannels*() #2049
This commit is contained in:
parent
6967723e53
commit
7108dc36c0
3
NEWS.md
3
NEWS.md
@ -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()`.
|
||||
|
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user