我理解不可能告诉Ascimatics使用终端的当前配色方案(因为asciimatics
无法查询终端)。但是我希望至少有一些控制,并且能够自己选择配色方案
我在文档中找不到如何更改默认前景/背景颜色
我正在使用standard demo:
from asciimatics.screen import Screen
from asciimatics.scene import Scene
from asciimatics.effects import Cycle, Stars
from asciimatics.renderers import FigletText
def demo(screen):
effects = [
Cycle(
screen,
FigletText("ASCIIMATICS", font='big'),
screen.height // 2 - 8),
Cycle(
screen,
FigletText("ROCKS!", font='big'),
screen.height // 2 + 3),
Stars(screen, (screen.width + screen.height) // 2)
]
screen.play([Scene(effects, 500)])
Screen.wrapper(demo)
我想背景是黄色的。不是文本元素的背景,而是整个背景(我想说的是Screen
的背景)
我该怎么做
对您的问题的简短回答是将
Background
效果添加到Scene
中。如文档所述here,您可以设置任何背景颜色但是,有些效果比其他效果更老,并且早于背景颜色支持。遗憾的是,
Cycle
和Stars
都在这个列表中,因此没有等效的bg
设置,因此需要进行更新才能按预期进行更改。我怀疑它们也需要调整,以期待后台将强制执行的完全刷新。如果需要,请访问asciimatics gitter频道相关问题 更多 >
编程相关推荐