@@ -68,6 +68,20 @@ The module :mod:`curses` defines the following exception:
6868The module :mod: `curses ` defines the following functions:
6969
7070
71+ .. function :: assume_default_colors(fg, bg)
72+
73+ Allow use of default values for colors on terminals supporting this feature.
74+ Use this to support transparency in your application.
75+
76+ Assign terminal default foreground/background colors to color number ``-1 ``.
77+ So ``init_pair(x, COLOR_RED, -1) `` will initialize pair *x * as red
78+ on default background and ``init_pair(x, -1, COLOR_BLUE) `` will
79+ initialize pair *x * as default foreground on blue.
80+ Change the definition of the color-pair ``0 `` to ``(fg, bg) ``.
81+
82+ .. versionadded :: next
83+
84+
7185.. function :: baudrate()
7286
7387 Return the output speed of the terminal in bits per second. On software
@@ -290,9 +304,11 @@ The module :mod:`curses` defines the following functions:
290304 Change the definition of a color-pair. It takes three arguments: the number of
291305 the color-pair to be changed, the foreground color number, and the background
292306 color number. The value of *pair_number * must be between ``1 `` and
293- ``COLOR_PAIRS - 1 `` (the ``0 `` color pair is wired to white on black and cannot
294- be changed). The value of *fg * and *bg * arguments must be between ``0 `` and
295- ``COLORS - 1 ``, or, after calling :func: `use_default_colors `, ``-1 ``.
307+ ``COLOR_PAIRS - 1 `` (the ``0 `` color pair can only be changed by
308+ :func: `use_default_colors ` and :func: `assume_default_colors `).
309+ The value of *fg * and *bg * arguments must be between ``0 `` and
310+ ``COLORS - 1 ``, or, after calling :func: `!use_default_colors ` or
311+ :func: `!assume_default_colors `, ``-1 ``.
296312 If the color-pair was previously initialized, the screen is
297313 refreshed and all occurrences of that color-pair are changed to the new
298314 definition.
@@ -678,11 +694,7 @@ The module :mod:`curses` defines the following functions:
678694
679695.. function :: use_default_colors()
680696
681- Allow use of default values for colors on terminals supporting this feature. Use
682- this to support transparency in your application. The default color is assigned
683- to the color number ``-1 ``. After calling this function, ``init_pair(x,
684- curses.COLOR_RED, -1) `` initializes, for instance, color pair *x * to a red
685- foreground color on the default background.
697+ Equivalent to ``assume_default_colors(-1, -1) ``.
686698
687699
688700.. function :: wrapper(func, /, *args, **kwargs)
0 commit comments