Fixed default foreground color

This commit is contained in:
Nite 2021-10-28 09:59:33 +02:00
parent c83a9778fc
commit 70e42fb443
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
1 changed files with 2 additions and 4 deletions

View File

@ -25,10 +25,8 @@ object ServerColor {
}
fun getForegroundColor(context: Context, serverColor: Int?): Int {
if (serverColor == null) return ContextCompat.getColor(
context, Util.getResourceFromAttribute(context, R.attr.colorOnPrimary)
)
val luminance = ColorUtils.calculateLuminance(serverColor)
val backgroundColor = getBackgroundColor(context, serverColor)
val luminance = ColorUtils.calculateLuminance(backgroundColor)
return if (luminance < LUMINANCE_LIMIT) {
ContextCompat.getColor(context, R.color.selected_menu_dark)
} else {