Skip to content

Commit

Permalink
change the on* colors (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordond authored Sep 19, 2024
1 parent 1d2614c commit ea31796
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,13 @@ public class MaterialDynamicColors(
DynamicColor.foregroundTone(primaryContainer().tone(scheme), 4.5)
}
isMonochrome(scheme) -> if (scheme.isDark) 0.0 else 100.0
else -> if (scheme.isDark) 90.0 else 10.0
else -> if (scheme.isDark) 90.0 else 30.0
}
},
isBackground = false,
background = { primaryContainer() },
secondBackground = null,
contrastCurve = ContrastCurve(4.5, 7.0, 11.0, 21.0),
contrastCurve = ContrastCurve(3.0, 4.5, 7.0, 11.0),
toneDeltaPair = null,
)

Expand Down Expand Up @@ -477,14 +477,15 @@ public class MaterialDynamicColors(
palette = { scheme -> scheme.secondaryPalette },
tone = { scheme ->
when {
!isFidelity(scheme) -> if (scheme.isDark) 90.0 else 10.0
isMonochrome(scheme) -> if (scheme.isDark) 90.0 else 10.0
!isFidelity(scheme) -> if (scheme.isDark) 90.0 else 30.0
else -> DynamicColor.foregroundTone(secondaryContainer().tone(scheme), 4.5)
}
},
isBackground = false,
background = { secondaryContainer() },
secondBackground = null,
contrastCurve = ContrastCurve(4.5, 7.0, 11.0, 21.0),
contrastCurve = ContrastCurve(3.0, 4.5, 7.0, 11.0),
toneDeltaPair = null,
)

Expand Down Expand Up @@ -562,14 +563,14 @@ public class MaterialDynamicColors(
tone = { scheme ->
when {
isMonochrome(scheme) -> if (scheme.isDark) 0.0 else 100.0
!isFidelity(scheme) -> if (scheme.isDark) 90.0 else 10.0
!isFidelity(scheme) -> if (scheme.isDark) 90.0 else 30.0
else -> DynamicColor.foregroundTone(tertiaryContainer().tone(scheme), 4.5)
}
},
isBackground = false,
background = { tertiaryContainer() },
secondBackground = null,
contrastCurve = ContrastCurve(4.5, 7.0, 11.0, 21.0),
contrastCurve = ContrastCurve(3.0, 4.5, 7.0, 11.0),
toneDeltaPair = null,
)

Expand Down Expand Up @@ -625,11 +626,16 @@ public class MaterialDynamicColors(
public fun onErrorContainer(): DynamicColor = DynamicColor(
name = "on_error_container",
palette = { scheme -> scheme.errorPalette },
tone = { scheme -> if (scheme.isDark) 90.0 else 10.0 },
tone = { scheme ->
when {
isMonochrome(scheme) -> if (scheme.isDark) 90.0 else 10.0
else -> if (scheme.isDark) 90.0 else 10.0
}
},
isBackground = false,
background = { errorContainer() },
secondBackground = null,
contrastCurve = ContrastCurve(4.5, 7.0, 11.0, 21.0),
contrastCurve = ContrastCurve(3.0, 4.5, 7.0, 11.0),
toneDeltaPair = null,
)

Expand Down

0 comments on commit ea31796

Please sign in to comment.