---
name: "notcurses_fade"
section: "3"
platform: "linux"
package: "notcurses"
version: "3.0.17-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/notcurses_fade"
---

# notcurses\_fade(3)

fade ncplanes in and out

## NAME

notcurses\_fade - fade ncplanes in and out

## 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 simple APIs for fading planes in and out. Fades require either RGB support or palette reprogramming support from the terminal (the RGB method is preferred, and will be used whenever possible). The **ts** parameter specifies the total amount of time for the fade operation. The operation itself is time-adaptive (i.e. 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

**[clock\_nanosleep(2)](/clock_nanosleep/2.md)**, **[notcurses(3)](/notcurses/3.md)**, **[notcurses\_plane(3)](/notcurses_plane/3.md)**

## AUTHORS

nick black ⟨nickblack@linux.com⟩\\c.
