From 7da32b263f0cb3700f4fbd80bbeba73e8a57ec1f Mon Sep 17 00:00:00 2001 From: koniifer Date: Sun, 10 Nov 2024 11:58:42 +0000 Subject: [PATCH] make the cursor more visible --- sysdata/programs/horizon/src/main.hb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb index 37cad69b..198307fc 100644 --- a/sysdata/programs/horizon/src/main.hb +++ b/sysdata/programs/horizon/src/main.hb @@ -133,7 +133,12 @@ main := fn(): int { render.put_rect(screen, .(0, 0), .(screen.width - 1, screen.height - 1), render.white) // render mouse - render.put_rect(screen, .(mouse_x, mouse_y), .(20, 20), render.white) + lum := render.indexptr(screen, mouse_x, mouse_y) + if lum.r / 3 + lum.g / 3 + lum.b / 3 < 128 { + render.put_rect(screen, .(mouse_x, mouse_y), .(20, 20), render.white) + } else { + render.put_rect(screen, .(mouse_x, mouse_y), .(20, 20), render.black) + } // Send events to focused window }