mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
keep the accent blobs dimmer than the primary button
This commit is contained in:
@@ -51,6 +51,7 @@ import com.subtracks.ui.settings.AddSourceState
|
||||
import com.subtracks.ui.settings.SettingsScreen
|
||||
import com.subtracks.ui.theme.SubtracksTheme
|
||||
import com.subtracks.ui.theme.artworkColorsFromSeed
|
||||
import com.subtracks.ui.theme.artworkColorsFromSeeds
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
@@ -133,6 +134,26 @@ class AppScreenshotTest {
|
||||
composeRule.onRoot().captureRoboImage("src/test/screenshots/album_detail.png")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun albumDetailCool() {
|
||||
composeRule.setContent {
|
||||
SubtracksTheme {
|
||||
AlbumDetailScreen(
|
||||
album = Fixtures.albums.first(),
|
||||
songs = Fixtures.songs,
|
||||
coverArt = { id, _ -> id?.let { CoverArtRef(it, "test:$it") } },
|
||||
artwork = artworkColorsFromSeeds(Color.rgb(45, 115, 240), Color.rgb(40, 180, 140)),
|
||||
onBack = {},
|
||||
onSongClick = {},
|
||||
playingSongId = Fixtures.songs.first().id,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
)
|
||||
}
|
||||
}
|
||||
awaitText("Everything In Its Right Place")
|
||||
composeRule.onRoot().captureRoboImage("src/test/screenshots/album_detail_cool.png")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun artistDetail() {
|
||||
composeRule.setContent {
|
||||
|
||||
@@ -35,6 +35,19 @@ class ArtworkColorsTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun buttonStandsOutFromGradient() {
|
||||
for (seed in seeds) {
|
||||
val colors = artworkColorsFromSeed(seed)
|
||||
val primary = colors.scheme.primary
|
||||
assertTrue("primary vs gradientHigh for $seed", contrast(primary, colors.gradientHigh) >= 2f)
|
||||
assertTrue("primary vs gradientLow for $seed", contrast(primary, colors.gradientLow) >= 2f)
|
||||
for (accent in colors.accents) {
|
||||
assertTrue("accent dimmer than primary for $seed", primary.luminance() > accent.luminance())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun contrast(
|
||||
a: Color,
|
||||
b: Color,
|
||||
|
||||
Reference in New Issue
Block a user