[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() { fun MaterialButton.elevatedAccentColor() {
if (materialYou) return if (materialYou) return
val color = ThemeStore.accentColor(context) val color = context.darkAccentColorVariant()
val colorStateList = ColorStateList.valueOf(color) rippleColor = ColorStateList.valueOf(color)
iconTint = colorStateList setBackgroundColor(color)
rippleColor = colorStateList setTextColor(MaterialValueHelper.getPrimaryTextColor(context, color.isColorLight))
iconTint = ColorStateList.valueOf(context.accentColor())
} }
fun SeekBar.applyColor(@ColorInt color: Int) { 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 inline val @receiver:ColorInt Int.isColorLight
get() = ColorUtil.isColorLight(this) get() = ColorUtil.isColorLight(this)