Rebrand the TV app as Wolfskin

This commit is contained in:
justinzeus 2026-10-22 15:05:37 +02:00
parent 7d6f041b55
commit e499c3f118
58 changed files with 230 additions and 93 deletions

View file

@ -0,0 +1,44 @@
package com.github.damontecres.wholphin.ui
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.luminance
import com.github.damontecres.wholphin.ui.theme.colors.WolfskinThemeColors
import org.junit.Assert.assertTrue
import org.junit.Test
/** Normal and focused TV text must remain readable on the fork's dark palette. */
class WolfskinThemeColorsTest {
@Test
fun darkPaletteHasReadableNormalAndFocusedText() {
val television = WolfskinThemeColors.darkScheme
val material = WolfskinThemeColors.darkSchemeMaterial
val textAndBackgrounds =
listOf(
television.onBackground to television.background,
television.onSurface to television.surface,
television.onSurfaceVariant to television.surfaceVariant,
television.onPrimary to television.primary,
television.onPrimaryContainer to television.primaryContainer,
television.onSecondary to television.secondary,
television.onSecondaryContainer to television.secondaryContainer,
television.onTertiary to television.tertiary,
television.onTertiaryContainer to television.tertiaryContainer,
material.onBackground to material.background,
material.onSurface to material.surface,
material.onPrimary to material.primary,
material.onPrimaryContainer to material.primaryContainer,
)
textAndBackgrounds.forEach { (text, background) ->
assertReadable(text, background)
}
}
private fun assertReadable(text: Color, background: Color) {
val textLuminance = text.luminance()
val backgroundLuminance = background.luminance()
val contrast =
(maxOf(textLuminance, backgroundLuminance) + .05f) /
(minOf(textLuminance, backgroundLuminance) + .05f)
assertTrue("Text contrast $contrast is below 4.5:1", contrast >= 4.5f)
}
}