You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
749 B
Plaintext
32 lines
749 B
Plaintext
5 years ago
|
#!/usr/bin/python3
|
||
|
|
||
5 years ago
|
import locale
|
||
|
from notcurses import notcurses
|
||
|
|
||
|
def demo():
|
||
5 years ago
|
nc = notcurses.Notcurses()
|
||
5 years ago
|
c = notcurses.Cell(nc.stdplane(), ord(' '))
|
||
5 years ago
|
c.setBgRGB(0x80, 0xc0, 0x80)
|
||
|
nc.stdplane().setBaseCell(c)
|
||
|
dims = nc.stdplane().getDimensions()
|
||
|
r = 0x80
|
||
|
g = 0x80
|
||
|
b = 0x80
|
||
|
for y in range(dims[0]):
|
||
|
for x in range(dims[1]):
|
||
|
nc.stdplane().setFgRGB(r, g, b)
|
||
|
nc.stdplane().setBgRGB(b, r, g)
|
||
5 years ago
|
nc.stdplane().putSimpleYX(y, x, ord('X'))
|
||
5 years ago
|
b = b + 2
|
||
|
if b == 256:
|
||
|
b = 0
|
||
|
g = g + 2
|
||
|
if g == 256:
|
||
|
g = 0
|
||
|
r = r + 2
|
||
|
nc.render()
|
||
|
|
||
5 years ago
|
|
||
|
locale.setlocale(locale.LC_ALL, "")
|
||
|
demo()
|