experiments/touchbar_rainbow.py: Better rainbow

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-04-23 18:12:09 +09:00
parent b8b76f34f4
commit a0f01809ce

View file

@ -18,9 +18,11 @@ buf = u.memalign(0x4000, fb_size)
colors = [0xDD0000, 0xFE6230, 0xFEF600, 0x00BB00, 0x009BFE, 0x000083, 0x30009B]
for i, color in enumerate(colors):
lines = stride // len(colors)
offset = i * lines * width * 4
p.memset32(buf + offset, color, lines * width * 4)
lines = width // len(colors)
offset = i * lines * stride * 4
for j in range(lines):
p.memset32(buf + offset + j * stride * 4, color, height * 2)
p.memset32(buf + offset + j * stride * 4 + height * 2, 0xffffffff^color, height * 2)