@@ -68,6 +68,21 @@ 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+
81+ * Change the definition of the color-pair ``0 `` to ``(fg, bg) ``.
82+
83+ .. versionadded :: next
84+
85+
7186.. function :: baudrate()
7287
7388 Return the output speed of the terminal in bits per second. On software
@@ -290,9 +305,11 @@ The module :mod:`curses` defines the following functions:
290305 Change the definition of a color-pair. It takes three arguments: the number of
291306 the color-pair to be changed, the foreground color number, and the background
292307 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 ``.
308+ ``COLOR_PAIRS - 1 `` (the ``0 `` color pair can only be changed by
309+ :func: `use_default_colors ` and :func: `assume_default_colors `).
310+ The value of *fg * and *bg * arguments must be between ``0 `` and
311+ ``COLORS - 1 ``, or, after calling :func: `!use_default_colors ` or
312+ :func: `!assume_default_colors `, ``-1 ``.
296313 If the color-pair was previously initialized, the screen is
297314 refreshed and all occurrences of that color-pair are changed to the new
298315 definition.
@@ -678,11 +695,7 @@ The module :mod:`curses` defines the following functions:
678695
679696.. function :: use_default_colors()
680697
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.
698+ Equivalent to ``assume_default_colors(-1, -1) ``.
686699
687700
688701.. function :: wrapper(func, /, *args, **kwargs)
0 commit comments