1#!/usr/bin/python3
2
3import locale
4from notcurses import notcurses
5
6def demo():
7    nc = notcurses.Notcurses()
8    stdplane = nc.stdplane()
9    dims = stdplane.getDimensions()
10    r = 0x80
11    g = 0x80
12    b = 0x80
13    for y in range(dims[0]):
14        for x in range(dims[1]):
15            stdplane.setFgRGB(r, g, b)
16            stdplane.setBgRGB(b, r, g)
17            stdplane.putEGCYX(y, x, "X")
18            b = b + 2
19            if b == 256:
20                b = 0
21                g = g + 2
22                if g == 256:
23                    g = 0
24                    r = r + 2
25    nc.render()
26
27
28locale.setlocale(locale.LC_ALL, "")
29demo()
30