notcurses_palette(3)
π NAME β notcurses_palette(3) π
okay so bestie, this is the manual page for notcurses_palette, and it is literally all about operations on notcurses palettes. π¨β¨
β¨ SYNOPSIS β¨
hereβs the exact cast of characters, no cap, zero typos:
#include <notcurses/notcurses.h>
typedef struct ncpalette {
// We store the RGB values as a regular ol' channel
uint32_t chans[NCPALETTESIZE];
} ncpalette;
bool notcurses_cantruecolor(const struct notcurses* nc);
ncpalette* ncpalette_new(struct notcurses* nc);
int ncpalette_use(struct notcurses* nc, const ncpalette* p);
int ncpalette_set_rgb8(ncpalette* p, int idx, int r, int g, int b);
int ncpalette_set(ncpalette* p, int idx, unsigned rgb);
int ncpalette_get(const ncpalette* p, int idx, uint32_t* palent);
int ncpalette_get_rgb8(const ncpalette* p, int idx, int* restrict r,
int* restrict g, int* restrict b);
void ncpalette_free(ncpalette* p);
bool notcurses_canchangecolors(const struct notcurses* nc);
π¦ DESCRIPTION π¦
some terminals are out here like βbestie I only do 256 colors,β but they still let you specify the full palette with arbitrary RGB colors. iconic behavior. π
in all cases, though, it is more performant to use indexed colors, because that is much less data to write to the terminal. so if you can limit yourself to 256 colors, thatβs probably for the best. fr fr. πΈ
plus, palette-based color allows for very fast color cycling effects, because a single command can affect many cells on the screen at once. the way thatβs so main character energy. ππ
β RETURN VALUES β
- functions returning
intreturn-1on failure, or0on success. failure is always due to invalid inputs. π«Ά - functions returning
boolare predicates, and they return the requested value. β - functions returning unsigned forms return the input, modified as requested. π
π SEE ALSO π
π AUTHORS π
nick black β nickblack@linux.com π
thatβs the whole vibe, bestie. this lil page is from the notcurses_palette(3) manual and is rockinβ version v3.0.17. πβ¨π¦
π¦ where this page comes from
- alpine 3.24: notcurses-doc 3.0.17-r0 Β· Apache-2.0
- ubuntu resolute: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- ubuntu stonking: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms