Skip to content

Commit a0f0180

Browse files
committed
experiments/touchbar_rainbow.py: Better rainbow
Signed-off-by: Hector Martin <[email protected]>
1 parent b8b76f3 commit a0f0180

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

proxyclient/experiments/touchbar_rainbow.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818

1919
colors = [0xDD0000, 0xFE6230, 0xFEF600, 0x00BB00, 0x009BFE, 0x000083, 0x30009B]
2020
for i, color in enumerate(colors):
21-
lines = stride // len(colors)
22-
offset = i * lines * width * 4
23-
p.memset32(buf + offset, color, lines * width * 4)
21+
lines = width // len(colors)
22+
offset = i * lines * stride * 4
23+
for j in range(lines):
24+
p.memset32(buf + offset + j * stride * 4, color, height * 2)
25+
p.memset32(buf + offset + j * stride * 4 + height * 2, 0xffffffff^color, height * 2)
2426

2527

2628

0 commit comments

Comments
 (0)