From a0f01809cea492515595451840feada3a7454b39 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sun, 23 Apr 2023 18:12:09 +0900 Subject: [PATCH] experiments/touchbar_rainbow.py: Better rainbow Signed-off-by: Hector Martin --- proxyclient/experiments/touchbar_rainbow.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxyclient/experiments/touchbar_rainbow.py b/proxyclient/experiments/touchbar_rainbow.py index af6b93ee..3c6bba96 100755 --- a/proxyclient/experiments/touchbar_rainbow.py +++ b/proxyclient/experiments/touchbar_rainbow.py @@ -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)