From 6245ce72233e0042417032df2b981388a9d065cf Mon Sep 17 00:00:00 2001 From: Cal Date: Fri, 22 Nov 2024 16:14:31 +1100 Subject: [PATCH] set start time immediately --- src/main/java/at/hannibal2/skyhanni/utils/SpecialColor.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SpecialColor.kt b/src/main/java/at/hannibal2/skyhanni/utils/SpecialColor.kt index d4cf776888ce..a71ff11e84ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SpecialColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SpecialColor.kt @@ -9,13 +9,11 @@ import java.awt.Color object SpecialColor { private const val MIN_CHROMA_SECS = 1 private const val MAX_CHROMA_SECS = 60 - private var startTime = SimpleTimeMark.farPast() + private val startTime = SimpleTimeMark.now() fun String.toSpecialColor() = Color(toSpecialColorInt(), true) fun String.toSpecialColorInt(): Int { - if (startTime.isFarPast()) startTime = SimpleTimeMark.now() - val (chroma, alpha, red, green, blue) = decompose(this) val (hue, sat, bri) = Color.RGBtoHSB(red, green, blue, null)