[Home] Tint home playlist buttons

This commit is contained in:
Prathamesh More 2021-12-23 18:25:31 +05:30
parent 0521125bcd
commit 886ade241f

View file

@ -130,10 +130,11 @@ fun MaterialButton.accentOutlineColor() {
fun MaterialButton.elevatedAccentColor() {
if (materialYou) return
val color = ThemeStore.accentColor(context)
val colorStateList = ColorStateList.valueOf(color)
iconTint = colorStateList
rippleColor = colorStateList
val color = context.darkAccentColorVariant()
rippleColor = ColorStateList.valueOf(color)
setBackgroundColor(color)
setTextColor(MaterialValueHelper.getPrimaryTextColor(context, color.isColorLight))
iconTint = ColorStateList.valueOf(context.accentColor())
}
fun SeekBar.applyColor(@ColorInt color: Int) {
@ -250,5 +251,14 @@ fun Context.darkAccentColor(): Int {
)
}
@ColorInt
fun Context.darkAccentColorVariant(): Int {
return ColorUtils.blendARGB(
accentColor(),
surfaceColor(),
if (surfaceColor().isColorLight) 0.9f else 0.95f
)
}
inline val @receiver:ColorInt Int.isColorLight
get() = ColorUtil.isColorLight(this)