feat: M3 Expressive theme with dynamic color + fallback scheme from slate seed

CalendulaSeed (0xFF5C6B7A) anchors the design palette. Theme picks
Dynamic Color on API 31+ when enabled (default true) and falls back
to a hand-tuned Light/Dark scheme otherwise. CalendulaTypography is
the M3 Expressive default for V1 - custom type scale lands in a
later UI-design iteration.

ColorSchemeTest pins the seed value (3 unit tests, all pass).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Luc Makiola
2026-06-08 15:39:28 +02:00
parent e4f445ac75
commit 4fe8cd12cb
4 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package de.jeanlucmakiola.calendula.ui.theme
import androidx.compose.ui.graphics.Color
import com.google.common.truth.Truth.assertThat
import org.junit.jupiter.api.Test
class ColorSchemeTest {
@Test
fun `seed color matches design spec slate`() {
// The seed color must remain stable - the design is anchored to it.
// Change this only if the spec is updated.
assertThat(CalendulaSeed).isEqualTo(Color(0xFF5C6B7A))
}
@Test
fun `light fallback scheme uses seed as primary derivation source`() {
val scheme = CalendulaLightFallback
// Primary should be a recognizable derivative of the seed (not neutral gray)
assertThat(scheme.primary).isNotEqualTo(Color.Black)
assertThat(scheme.primary).isNotEqualTo(Color.White)
}
@Test
fun `dark fallback scheme differs from light`() {
assertThat(CalendulaDarkFallback.background).isNotEqualTo(CalendulaLightFallback.background)
}
}