Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions commons/src/main/kotlin/org/fossify/commons/extensions/Int.kt
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,12 @@ fun Int.countdown(intervalMillis: Long, callback: (count: Int) -> Unit) {
(this - 1).countdown(intervalMillis, callback)
}
}

fun Int.adjustSimColorForBackground(bg: Int): Int {
val hsv = FloatArray(3)
Color.colorToHSV(bg, hsv)
if (hsv[2] < 0.5) {
return this.lightenColor(24)
}
return this
}
Loading