fix(theme): complete color and component contrast contracts (#1417)
This commit is contained in:
22 files changed
+1013
-318
No files matched your search
@@ -28,6 +28,9 @@ enum class ThemeMode { FULL, DARK_ONLY, LIGHT_ONLY }
|
||||
*
|
||||
* The Material error slots are derived from [status] — the theme author
|
||||
* defines semantic colors once and the scheme inherits them.
|
||||
* [primary] and the status error are also used directly for text on surfaces.
|
||||
* [outline] must contrast with [surface] and [surfaceContainerHighest], which
|
||||
* Material uses as the unchecked switch track.
|
||||
*/
|
||||
data class PaletteColors(
|
||||
val primary: Color,
|
||||
@@ -48,6 +51,20 @@ data class PaletteColors(
|
||||
val onSurface: Color,
|
||||
val surfaceVariant: Color,
|
||||
val onSurfaceVariant: Color,
|
||||
val surfaceDim: Color,
|
||||
val surfaceBright: Color,
|
||||
val primaryFixed: Color,
|
||||
val primaryFixedDim: Color,
|
||||
val onPrimaryFixed: Color,
|
||||
val onPrimaryFixedVariant: Color,
|
||||
val secondaryFixed: Color,
|
||||
val secondaryFixedDim: Color,
|
||||
val onSecondaryFixed: Color,
|
||||
val onSecondaryFixedVariant: Color,
|
||||
val tertiaryFixed: Color,
|
||||
val tertiaryFixedDim: Color,
|
||||
val onTertiaryFixed: Color,
|
||||
val onTertiaryFixedVariant: Color,
|
||||
val surfaceContainerLowest: Color,
|
||||
val surfaceContainerLow: Color,
|
||||
val surfaceContainer: Color,
|
||||
@@ -123,6 +140,20 @@ private fun darkSchemeOf(c: PaletteColors): ColorScheme =
|
||||
surfaceVariant = c.surfaceVariant,
|
||||
onSurfaceVariant = c.onSurfaceVariant,
|
||||
surfaceTint = c.primary,
|
||||
surfaceDim = c.surfaceDim,
|
||||
surfaceBright = c.surfaceBright,
|
||||
primaryFixed = c.primaryFixed,
|
||||
primaryFixedDim = c.primaryFixedDim,
|
||||
onPrimaryFixed = c.onPrimaryFixed,
|
||||
onPrimaryFixedVariant = c.onPrimaryFixedVariant,
|
||||
secondaryFixed = c.secondaryFixed,
|
||||
secondaryFixedDim = c.secondaryFixedDim,
|
||||
onSecondaryFixed = c.onSecondaryFixed,
|
||||
onSecondaryFixedVariant = c.onSecondaryFixedVariant,
|
||||
tertiaryFixed = c.tertiaryFixed,
|
||||
tertiaryFixedDim = c.tertiaryFixedDim,
|
||||
onTertiaryFixed = c.onTertiaryFixed,
|
||||
onTertiaryFixedVariant = c.onTertiaryFixedVariant,
|
||||
surfaceContainerLowest = c.surfaceContainerLowest,
|
||||
surfaceContainerLow = c.surfaceContainerLow,
|
||||
surfaceContainer = c.surfaceContainer,
|
||||
@@ -161,6 +192,20 @@ private fun lightSchemeOf(c: PaletteColors): ColorScheme =
|
||||
surfaceVariant = c.surfaceVariant,
|
||||
onSurfaceVariant = c.onSurfaceVariant,
|
||||
surfaceTint = c.primary,
|
||||
surfaceDim = c.surfaceDim,
|
||||
surfaceBright = c.surfaceBright,
|
||||
primaryFixed = c.primaryFixed,
|
||||
primaryFixedDim = c.primaryFixedDim,
|
||||
onPrimaryFixed = c.onPrimaryFixed,
|
||||
onPrimaryFixedVariant = c.onPrimaryFixedVariant,
|
||||
secondaryFixed = c.secondaryFixed,
|
||||
secondaryFixedDim = c.secondaryFixedDim,
|
||||
onSecondaryFixed = c.onSecondaryFixed,
|
||||
onSecondaryFixedVariant = c.onSecondaryFixedVariant,
|
||||
tertiaryFixed = c.tertiaryFixed,
|
||||
tertiaryFixedDim = c.tertiaryFixedDim,
|
||||
onTertiaryFixed = c.onTertiaryFixed,
|
||||
onTertiaryFixedVariant = c.onTertiaryFixedVariant,
|
||||
surfaceContainerLowest = c.surfaceContainerLowest,
|
||||
surfaceContainerLow = c.surfaceContainerLow,
|
||||
surfaceContainer = c.surfaceContainer,
|
||||
|
||||
Reference in new issue
Block a user