---
name: "dft_fgbg"
section: "3ncurses"
platform: "linux"
package: "libncurses4-dev"
version: "4.2-3"
release: "Debian 2.1 (Slink)"
platforms: ["linux"]
url: "https://new.carta.tech/dft_fgbg"
---

# dft\_fgbg(3ncurses)

use terminal's default colors

## NAME

**dft\_fgbg** - use terminal's default colors

## SYNOPSIS

**#include \<curses.h\>**

**int use\_default\_colors(void);**

## DESCRIPTION

This is an extension to the curses library. It is used with terminals that support ISO 6429 color, or equivalent. These terminals allow the application to reset color to an unspecified default value (e.g., with SGR 39 or SGR 49). Because they are designed to support this, their design usually includes features to change the default foreground or background colors so that they do not match the assumption in XSI curses of white on black.

Applications that paint a colored background over the whole screen are not adversely impacted by this type of terminal design. However, there are applications that are designed to work with the default background.

## RETURN VALUE

The function returns the integer **ERR** upon failure and **OK** on success. It will fail if either the terminal does not support the *orig\_pair* or *orig\_colors* capability. If the *initialize\_pair* capability is found, this causes an error as well.

## NOTES

Associated with this extension, the **init\_pair**(3X) function accepts negative arguments to specify default foreground or background colors.

## PORTABILITY

These routines are specific to ncurses.  They were not supported on Version 7, BSD or System V implementations.  It is recommended that any code depending on them be conditioned using NCURSES\_VERSION.

## SEE ALSO

**color**(3NCURSES), **ded**(1).

## AUTHOR

Thomas Dickey (from an analysis of the requirements for color xterm for XFree86 3.1.2C, February 1996).
