Improve menu icon colors

This commit is contained in:
vfsfitvnm 2022-08-28 12:49:52 +02:00
parent c4122ddd9c
commit ac0bc125e4
2 changed files with 12 additions and 4 deletions

View file

@ -28,6 +28,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import it.vfsfitvnm.vimusic.R import it.vfsfitvnm.vimusic.R
import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance
import it.vfsfitvnm.vimusic.ui.styling.menuEntryIcon
import it.vfsfitvnm.vimusic.utils.medium import it.vfsfitvnm.vimusic.utils.medium
import it.vfsfitvnm.vimusic.utils.secondary import it.vfsfitvnm.vimusic.utils.secondary
@ -78,9 +79,9 @@ fun MenuEntry(
Image( Image(
painter = painterResource(icon), painter = painterResource(icon),
contentDescription = null, contentDescription = null,
colorFilter = ColorFilter.tint(colorPalette.text), colorFilter = ColorFilter.tint(colorPalette.menuEntryIcon),
modifier = Modifier modifier = Modifier
.size(14.dp) .size(15.dp)
) )
Column { Column {

View file

@ -29,7 +29,7 @@ val DefaultDarkColorPalette = ColorPalette(
text = Color(0xffe1e1e2), text = Color(0xffe1e1e2),
textSecondary = Color(0xffa3a4a6), textSecondary = Color(0xffa3a4a6),
textDisabled = Color(0xff6f6f73), textDisabled = Color(0xff6f6f73),
accent = Color(0xff4046bf), accent = Color(0xff5055c0),
onAccent = Color.White, onAccent = Color.White,
isDark = true isDark = true
) )
@ -41,7 +41,7 @@ val DefaultLightColorPalette = ColorPalette(
text = Color(0xff212121), text = Color(0xff212121),
textSecondary = Color(0xff656566), textSecondary = Color(0xff656566),
textDisabled = Color(0xff9d9d9d), textDisabled = Color(0xff9d9d9d),
accent = Color(0xff4046bf), accent = Color(0xff5055c0),
onAccent = Color.White, onAccent = Color.White,
isDark = false isDark = false
) )
@ -133,6 +133,13 @@ inline val ColorPalette.shimmer: Color
accent accent
} }
inline val ColorPalette.menuEntryIcon: Color
get() = if (this === DefaultDarkColorPalette || this === DefaultLightColorPalette || this == PureBlackColorPalette) {
text
} else {
accent
}
inline val ColorPalette.overlay: Color inline val ColorPalette.overlay: Color
get() = PureBlackColorPalette.background0.copy(alpha = 0.75f) get() = PureBlackColorPalette.background0.copy(alpha = 0.75f)