Add possibility to define the background color of entities (black in ASCII, white in Unicode)

This commit is contained in:
Yohann D'ANELLO
2020-11-10 22:30:55 +01:00
parent ec6b90fba2
commit a8223aab2e
5 changed files with 32 additions and 7 deletions

View File

@ -19,6 +19,13 @@ class Display:
def newpad(self, height: int, width: int) -> Union[FakePad, Any]:
return curses.newpad(height, width) if self.screen else FakePad()
def init_pair(self, number: int, foreground: int, background: int) -> None:
return curses.init_pair(number, foreground, background) \
if self.screen else None
def color_pair(self, number: int) -> int:
return curses.color_pair(number) if self.screen else 0
def resize(self, y: int, x: int, height: int, width: int) -> None:
self.x = x
self.y = y