On this page
curses.init_pair
Prev: curses.init_color | Up: curses | Next: curses.initscr
Rel: curses.assume_default_colors, curses.baudrate, curses.beep, curses.can_change_color
Ref: docs.python.org — curses.init_pair
Tags: #public #python3 #stdlib #curses
Import
import curses
from curses import init_pair
Signature & Overview
curses.init_pair(pair_number, fg, bg, /)
Change the definition of a color-pair.
Usage
import curses
# Registers a foreground/background pair: curses.init_pair(1, curses.COLOR_GREEN, -1)
assert callable(curses.init_pair)
Gotchas
- Pair
0is reserved for default terminal colors: Start custom pairs at1.
REPL Inspect
from curses import init_pair
help(init_pair)
Linked from
Related notes
- tuts/python3/stdlib_module/curses/init_color Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/initscr Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/curses/assume_default_colors Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/baudrate Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/beep Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/can_change_color Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/cbreak shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/color_content shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/color_pair shared tags: #curses, #stdlib