mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-16 19:50:35 +01:00
Fixed default foreground color
This commit is contained in:
parent
c83a9778fc
commit
70e42fb443
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user