.\" Automatically generated by Pandoc 3.1.8 .\" .TH "notcurses_palette" "3" "v3.0.9" "" "" .SH NAME notcurses_palette - operations on notcurses palettes .SH SYNOPSIS \f[B]#include \f[R] .IP .EX typedef struct ncpalette { // We store the RGB values as a regular ol\[aq] channel uint32_t chans[NCPALETTESIZE]; } ncpalette; .EE .PP \f[B]bool notcurses_cantruecolor(const struct notcurses* \f[R]\f[I]nc\f[R]\f[B]);\f[R] .PP \f[B]ncpalette* ncpalette_new(struct notcurses* \f[R]\f[I]nc\f[R]\f[B]);\f[R] .PP \f[B]int ncpalette_use(struct notcurses* \f[R]\f[I]nc\f[R]\f[B], const ncpalette* \f[R]\f[I]p\f[R]\f[B]);\f[R] .PP \f[B]int ncpalette_set_rgb8(ncpalette* \f[R]\f[I]p\f[R]\f[B], int \f[R]\f[I]idx\f[R]\f[B], int \f[R]\f[I]r\f[R]\f[B], int \f[R]\f[I]g\f[R]\f[B], int \f[R]\f[I]b\f[R]\f[B]);\f[R] .PP \f[B]int ncpalette_set(ncpalette* \f[R]\f[I]p\f[R]\f[B], int \f[R]\f[I]idx\f[R]\f[B], unsigned \f[R]\f[I]rgb\f[R]\f[B]);\f[R] .PP \f[B]int ncpalette_get(const ncpalette* \f[R]\f[I]p\f[R]\f[B], int \f[R]\f[I]idx\f[R]\f[B], uint32_t* \f[R]\f[I]palent\f[R]\f[B]);\f[R] .PP \f[B]int ncpalette_get_rgb8(const ncpalette* \f[R]\f[I]p\f[R]\f[B], int \f[R]\f[I]idx\f[R]\f[B], int* restrict \f[R]\f[I]r\f[R]\f[B], int* restrict \f[R]\f[I]g\f[R]\f[B], int* restrict \f[R]\f[I]b\f[R]\f[B]);\f[R] .PP \f[B]void ncpalette_free(ncpalette* \f[R]\f[I]p\f[R]\f[B]);\f[R] .PP \f[B]bool notcurses_canchangecolors(const struct notcurses* \f[R]\f[I]nc\f[R]\f[B]);\f[R] .SH DESCRIPTION Some terminals only support 256 colors, but allow the full palette to be specified with arbitrary RGB colors. In all cases, it\[aq]s more performant to use indexed colors, since it\[aq]s much less data to write to the terminal. If you can limit yourself to 256 colors, that\[aq]s probably for the best. .PP In addition, palette-based color allows for very fast color cycling effects, since a single command can affect many cells on the screen. .SH RETURN VALUES Functions returning \f[B]int\f[R] return -1 on failure, or 0 on success. Failure is always due to invalid inputs. Functions returning \f[B]bool\f[R] are predicates, and return the requested value. Functions returning \f[B]unsigned\f[R] forms return the input, modified as requested. .SH SEE ALSO \f[B]notcurses(3)\f[R], \f[B]notcurses_cell(3)\f[R], \f[B]notcurses_channels(3)\f[R], \f[B]notcurses_output(3)\f[R], \f[B]notcurses_plane(3)\f[R] .SH AUTHORS nick black .