Fix - Invalid parameter name for seed color (#39)

This commit is contained in:
Jordon de Hoog 2024-11-07 11:02:41 -05:00 committed by GitHub
parent cf30b4f0c3
commit 2c2a764b94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -8,7 +8,7 @@ fun mkColorsKt(
colors: ColorSettings,
): String {
val colorList = listOfNotNull(
if (colors.primary == null) colors.seed.variable("Seed")
if (colors.primary == null) colors.seed.variable("SeedColor")
else colors.primary.variable("Primary"),
colors.secondary.variable("Secondary"),
colors.tertiary.variable("Tertiary"),

View file

@ -20,7 +20,7 @@ fun mkThemeKt(
contrast,
settings.isAmoled.parameter("isAmoled"),
settings.isExtendedFidelity.parameter("extendedFidelity"),
if (settings.colors.primary == null) settings.colors.seed.parameter("Seed")
if (settings.colors.primary == null) settings.colors.seed.parameter("SeedColor")
else settings.colors.primary.parameter("Primary"),
settings.colors.secondary.parameter("Secondary"),
settings.colors.tertiary.parameter("Tertiary"),

View file

@ -49,7 +49,7 @@ class MKColorsTest {
val result = mkColorsKt("com.example", colorSettings)
assertTrue(result.contains("val Seed = Color(0xFF000000)"))
assertTrue(result.contains("val SeedColor = Color(0xFF000000)"))
assertFalse(result.contains("val Primary = "))
}
@ -164,7 +164,7 @@ class MKColorsTest {
import androidx.compose.ui.graphics.Color
val Seed = Color(0xFF000000)
val SeedColor = Color(0xFF000000)
""".trimIndent()
assertEquals(expectedOutput, result)

View file

@ -114,7 +114,7 @@ fun MyTheme(
contrastLevel = 1.0,
isAmoled = true,
extendedFidelity = true,
seed = Seed,
seedColor = SeedColor,
)
DynamicMaterialTheme(