From 6ac81a31ed1852cba818e5fa0d90db836b0b9ead Mon Sep 17 00:00:00 2001 From: kross <135918757+krossgg@users.noreply.github.com> Date: Sat, 21 Dec 2024 18:46:11 -0500 Subject: [PATCH] Fix rainbow math (#2619) --- .../java/com/gregtechceu/gtceu/client/util/TooltipHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/client/util/TooltipHelper.java b/src/main/java/com/gregtechceu/gtceu/client/util/TooltipHelper.java index 7a3d141b6c..3e2cf077e0 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/util/TooltipHelper.java +++ b/src/main/java/com/gregtechceu/gtceu/client/util/TooltipHelper.java @@ -20,11 +20,11 @@ public class TooltipHelper { /** * Returns a continually changing rainbow TextColor * - * @param speed degrees of hue change per tick, or equivalently, number of complete hue cycles per 360 ticks + * @param speed degrees of hue change per tick * @return Rainbow TextColor */ public static TextColor rainbowColor(float speed) { - return TextColor.fromRgb(GradientUtil.toRGB((GTValues.CLIENT_TIME % 360) * speed, 95f, 60f)); + return TextColor.fromRgb(GradientUtil.toRGB((GTValues.CLIENT_TIME & ((1 << 20) - 1)) * speed, 95f, 60f)); } public static final UnaryOperator