notcurses_fade(3)
π NAME π
okay so this is the manual page for notcurses_fade(3), and it is literally about fading ncplanes in and out, bestie. β¨
π¦ SYNOPSIS π¦
#include <notcurses/notcurses.h>
struct ncfadectx;
// Called for each delta performed in a fade on ncp. If anything but 0 is
// returned, the fading operation ceases immediately, and that value is
// propagated out. If provided and not NULL, the faders will not themselves
// call notcurses_render().
typedef int (*fadecb)(struct notcurses* nc, struct ncplane* ncp,
const struct timespec*, void* curry);
bool notcurses_canfade(const struct notcurses* nc);
int ncplane_fadeout(struct ncplane* n, const struct timespec* ts, fadecb
fader, void* curry);
int ncplane_fadein(struct ncplane* n, const struct timespec* ts, fadecb
fader, void* curry);
int ncplane_pulse(struct ncplane* n, const struct timespec* ts, fadecb
fader, void* curry);
struct ncfadectx* ncfadectx_setup(struct ncplane* n);
int ncfadectx_iterations(const struct ncfadectx* nctx);
int ncplane_fadeout_iteration(struct ncplane* n, struct ncfadectx* nctx,
int iter, fadecb fader, void* curry);
int ncplane_fadein_iteration(struct ncplane* n, struct ncfadectx* nctx,
int iter, fadecb fader, void* curry);
void ncfadectx_free(struct ncfadectx* nctx);
π DESCRIPTION π
ncplane_fadeout, ncplane_fadein, and ncplane_pulse are the simple APIs for fading planes in and out. π«Ά
Fades require either RGB support or palette reprogramming support from the terminal β and the RGB method is preferred, so it will be used whenever possible. The ts parameter specifies the total amount of time for the fade operation. The operation itself is time-adaptive: if it finds itself falling behind, it will skip iterations; if it is proceeding too quickly, it will sleep. β³
These are wrappers around the more flexible ncfadectx API. Create an ncfadectx with ncfadectx_setup. The number of possible state changes (iterations) can be accessed with ncfadectx_iterations. A state can be reached with ncplane_fadeout_iteration or ncplane_fadein_iteration. Finally, destroy the ncfadectx with ncfadectx_free. π
π RETURN VALUES π
ncplane_fadeout_iteration and ncplane_fadein_iteration will propagate out any non-zero return value from the callback fader. π
π BUGS π
Palette reprogramming can affect other contents of the terminal in complex ways. This is not a problem when the RGB method is used. π
π SEE ALSO π
π«Ά AUTHORS π«Ά
nick black β nickblack@linux.com π
okay that's the whole page, bestie! sign-off vibes: source/version is v3.0.17, the footer stamps notcurses_fade(3), and there is no separate date line in that footer β so I'm not out here inventing one. ππ
π¦ 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