Skip to content

Commit

Permalink
set start time immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs committed Nov 22, 2024
1 parent b5a688f commit 6245ce7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/at/hannibal2/skyhanni/utils/SpecialColor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6245ce7

Please sign in to comment.