From 3509ab2cf76544391b5b0de1f5416d4a378a6bd7 Mon Sep 17 00:00:00 2001 From: Naomi Kirby Date: Thu, 8 Aug 2024 23:38:50 -0700 Subject: [PATCH] Some more HSV math fixes --- initfs/is31fl3737.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initfs/is31fl3737.py b/initfs/is31fl3737.py index e40141a..5d493c7 100644 --- a/initfs/is31fl3737.py +++ b/initfs/is31fl3737.py @@ -52,14 +52,14 @@ def hsv(self, hue, sat, val=255): """ # Convert hue to an angle and compute the remainder mod 60 hue = int(hue * 360) % 360 - rem = hue // 60 + rem = hue % 60 # Convert saturation into a byte and do the rest in fixed point. sat = int(sat * 256) val = int(val) p = val * (256 - sat) >> 8 q = val * (256 - (rem * sat // 60)) >> 8 - t = val * (256 - (256 - rem) * sat // 60) >> 8 + t = val * (256 - (60 - rem) * sat // 60) >> 8 if hue < 60: self.r = val