Harmonize background color in favicon fallback
This commit is contained in:
@@ -4,6 +4,9 @@ import android.content.Context
|
||||
import android.graphics.*
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import com.google.android.material.color.MaterialColors
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.utils.ext.getThemeColor
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
class FaviconFallbackDrawable(
|
||||
@@ -13,7 +16,7 @@ class FaviconFallbackDrawable(
|
||||
|
||||
private val paint = Paint(Paint.ANTI_ALIAS_FLAG)
|
||||
private val letter = name.take(1).uppercase()
|
||||
private val color = colorOfString(name)
|
||||
private val color = MaterialColors.harmonize(colorOfString(name), context.getThemeColor(android.R.attr.colorPrimary))
|
||||
private val textBounds = Rect()
|
||||
private val tempRect = Rect()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user