On this page
curses.init_color
Prev: curses.has_key | Up: curses | Next: curses.init_pair
Rel: curses.assume_default_colors, curses.baudrate, curses.beep, curses.can_change_color
Ref: docs.python.org — curses.init_color
Tags: #public #python3 #stdlib #curses
Import
import curses
from curses import init_color
Signature & Overview
curses.init_color(color_number, r, g, b, /)
Change the definition of a color.
Usage
import curses
# Redefines a color slot: curses.init_color(color_num, r, g, b) with 0..1000 values
assert callable(curses.init_color)
Gotchas
- Check
curses.can_change_color()first and note RGB values are0..1000, not0..255.
REPL Inspect
from curses import init_color
help(init_color)
Linked from
Related notes
- tuts/python3/stdlib_module/curses/has_key Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/init_pair 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