diff --git a/doc/man/man3/notcurses_cell.3.md b/doc/man/man3/notcurses_cell.3.md index fc97d4654..479fdb80d 100644 --- a/doc/man/man3/notcurses_cell.3.md +++ b/doc/man/man3/notcurses_cell.3.md @@ -112,6 +112,18 @@ typedef struct nccell { **bool nccell_bg_default_p(const nccell* ***c***);** +**int nccell_set_fg_palindex(nccell* ***cl***, int ***idx***);** + +**int nccell_set_bg_palindex(nccell* ***cl***, int ***idx***);** + +**uint32_t nccell_fg_palindex(const nccell* ***cl***);** + +**uint32_t nccell_bg_palindex(const nccell* ***cl***);** + +**bool nccell_fg_palindex_p(const nccell* ***cl***);** + +**bool nccell_bg_palindex_p(const nccell* ***cl***);** + **int ncstrwidth(const char* ***text***)**; **int ncstrwidth_valid(const char* ***text***, int* ***validbytes***, int* ***validwidth***)**; @@ -147,6 +159,13 @@ string, or -1 if an error is encountered. In either case, the number of valid bytes and columns, respectively, consumed before error into ***validbytes*** and ***validwidth*** (assuming them to not be **NULL**). +**nccell_fg_palindex** extracts the palette index from a cell's foreground +channel. The channel must be palette-indexed, or the return value is +meaningless. Verify palette indexing with **nccell_fg_palindex_p**. A cell's +foreground channel can be set to palette-indexed mode (and have the index set) +with **nccell_set_fg_palindex**. The index must be less than **NCPALETTESIZE**. +Replace **fg** with **bg** to operate on the background channel. + # RETURN VALUES **nccell_load** and similar functions return the number of bytes loaded from the diff --git a/doc/man/man3/notcurses_palette.3.md b/doc/man/man3/notcurses_palette.3.md index 773bd834c..5cd83ce9c 100644 --- a/doc/man/man3/notcurses_palette.3.md +++ b/doc/man/man3/notcurses_palette.3.md @@ -13,7 +13,7 @@ notcurses_palette - operations on notcurses palettes ```c typedef struct ncpalette { // We store the RGB values as a regular ol' channel - uint32_t chans[256]; + uint32_t chans[NCPALETTESIZE]; } ncpalette; ```