Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Domi04151309 committed Feb 9, 2025
1 parent 2284b76 commit 65482e9
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.domi04151309.alwayson.helpers;
package io.github.domi04151309.alwayson.helpers

import android.graphics.Color
import kotlin.math.roundToInt

object ColorHelper {
fun boostColor(color: Int): Int {
Expand All @@ -14,11 +13,10 @@ object ColorHelper {
} else {
val rgbMax: Int = maxOf(colorRed, colorGreen, colorBlue)
val rgbFactor: Float = 255 / rgbMax.toFloat()
val boostedRed: Int = minOf(255, (colorRed * rgbFactor).roundToInt())
val boostedGreen: Int = minOf(255, (colorGreen * rgbFactor).roundToInt())
val boostedBlue: Int = minOf(255, (colorBlue * rgbFactor).roundToInt())
val boostedRed: Int = minOf(255, (colorRed * rgbFactor).toInt())
val boostedGreen: Int = minOf(255, (colorGreen * rgbFactor).toInt())
val boostedBlue: Int = minOf(255, (colorBlue * rgbFactor).toInt())
Color.rgb(boostedRed, boostedGreen, boostedBlue)
}
}
}

0 comments on commit 65482e9

Please sign in to comment.