Normalize volume for brightness

Undo an unintentional change done in f6a429e.
The brightness was calculated from the normalized volume, but when factoring
the norm out in the history, that norm was dropped.
This commit is contained in:
Fabian Wiesel
2024-03-30 07:36:56 +01:00
parent 33a7a82a6a
commit 4200a19378

View File

@@ -52,10 +52,11 @@ class VolumeView : View {
val width = width val width = width
val size = volumeHistory.size() // Size is at most width val size = volumeHistory.size() // Size is at most width
val volumeNorm = volumeHistory.volumeNorm val volumeNorm = volumeHistory.volumeNorm
val minBrightness = 0.3
val relativeBrightness: Double = if (size > 0) { val relativeBrightness: Double = if (size > 0) {
volumeHistory[size - 1].coerceAtLeast(0.3) (volumeNorm * volumeHistory[size - 1]).coerceAtLeast(minBrightness)
} else { } else {
0.3 minBrightness
} }
val blue: Int val blue: Int
val rest: Int val rest: Int