mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
derive the secondary text colour from the gradient luminance
This commit is contained in:
@@ -48,6 +48,17 @@ class ArtworkColorsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun secondaryTextReadsOnGradient() {
|
||||
for (seed in seeds) {
|
||||
val colors = artworkColorsFromSeed(seed)
|
||||
val backdrop =
|
||||
(listOf(colors.gradientHigh, colors.gradientLow) + colors.accents)
|
||||
.maxBy { it.luminance() }
|
||||
assertTrue("onSurfaceVariant for $seed", contrast(colors.scheme.onSurfaceVariant, backdrop) >= 3f)
|
||||
}
|
||||
}
|
||||
|
||||
private fun contrast(
|
||||
a: Color,
|
||||
b: Color,
|
||||
|
||||
Reference in New Issue
Block a user