Six looks: every screen takes its colours from the chosen theme
Orbit Night, Daybreak, Nebula, Retro Tube (with scanlines), Deep Sea and High Contrast, from the approved design. Colours are theme tokens read while drawing, so a choice applies at once everywhere. Orbit Night stays colour for colour the same. Text uses Ink, text on the accent OnAccent; the cast, idents, takeover marks and game boards keep their own colours. Choose your look comes right after Welcome in onboarding (the tour puts yours back), and in Settings > Look. Every look is tested for readable contrast. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import org.junit.Test
|
||||
|
||||
class OnboardingTest {
|
||||
@Test fun theStepsRunInTheDesignedOrder() {
|
||||
assertEquals(listOf("Welcome", "Server", "Sign in", "Channels", "Who watches", "All set"), OnboardStep.entries.map { it.label })
|
||||
assertEquals(listOf("Welcome", "Look", "Server", "Sign in", "Channels", "Who watches", "All set"), OnboardStep.entries.map { it.label })
|
||||
}
|
||||
|
||||
@Test fun theStartingChannelsAreRealAndNeverAfterDark() {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package tv.orbit.classic
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.luminance
|
||||
import org.junit.After
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
/** The six looks (Paul, 5 November 2026): Orbit Night exactly as it was, and every look readable. */
|
||||
class ThemesTest {
|
||||
@After fun reset() = OrbitTheme.use(OrbitLook.Night)
|
||||
private fun contrast(a: Color, b: Color): Double {
|
||||
val (hi, lo) = listOf(a.luminance().toDouble(), b.luminance().toDouble()).sortedDescending()
|
||||
return (hi + .05) / (lo + .05)
|
||||
}
|
||||
|
||||
@Test fun orbitNightIsTheOriginalColourForColour() {
|
||||
OrbitTheme.use(OrbitLook.Night)
|
||||
assertEquals(Color(0xFF071632), Navy); assertEquals(Color(0xFF12356B), Panel); assertEquals(Color(0xFF194C91), Blue)
|
||||
assertEquals(Color(0xFFFFDE59), Yellow); assertEquals(Color(0xFFB7CBE8), Muted); assertEquals(Color(0xFF0C2148), Deep)
|
||||
assertEquals(Color(0xFF7FD1FF), Sky); assertEquals(Color(0xFF7EE0A8), Mint); assertEquals(Color.White, Ink); assertEquals(Navy, OnAccent)
|
||||
assertEquals(Color(0xFFF2C14E), Gold)
|
||||
assertEquals(Color(0xFF0A1E42), themed(Color(0xFF0A1E42)) { Deep })
|
||||
}
|
||||
|
||||
@Test fun everyLookIsReadable() {
|
||||
for (look in OrbitLook.entries) {
|
||||
val p = look.palette
|
||||
for ((name, back) in listOf("background" to p.background, "surface" to p.surface, "deep" to p.deep, "later" to p.later, "chair" to p.chairPanel)) {
|
||||
assertTrue("${look.title}: text on $name ${contrast(p.ink, back)}", contrast(p.ink, back) >= 7.0)
|
||||
assertTrue("${look.title}: secondary text on $name ${contrast(p.muted, back)}", contrast(p.muted, back) >= 4.5)
|
||||
}
|
||||
assertTrue("${look.title}: text on raised", contrast(p.ink, p.raised) >= 4.5)
|
||||
assertTrue("${look.title}: text on the accent ${contrast(p.onAccent, p.accent)}", contrast(p.onAccent, p.accent) >= 4.5)
|
||||
assertTrue("${look.title}: focus ring on panels ${contrast(p.accent, p.surface)}", contrast(p.accent, p.surface) >= 3.0)
|
||||
for ((name, c) in listOf("sky" to p.sky, "mint" to p.mint, "gold" to p.gold))
|
||||
assertTrue("${look.title}: $name on the page ${contrast(c, p.background)}", contrast(c, p.background) >= 3.0)
|
||||
assertTrue("${look.title}: tags on mint", contrast(p.onAccent, p.mint) >= 3.0)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun theChosenLookIsWhatEveryTokenReads() {
|
||||
OrbitTheme.use(OrbitLook.Daybreak)
|
||||
assertEquals(OrbitLook.Daybreak.palette.background, Navy); assertEquals(OrbitLook.Daybreak.palette.ink, Ink)
|
||||
assertNotEquals(Color(0xFF0A1E42), themed(Color(0xFF0A1E42)) { Deep })
|
||||
// Things with their own colours keep them.
|
||||
assertEquals(Color(0xFF071632), NightNavy)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user