Added in 1.1.0-rc01
class ColorScheme(
primary: Color,
onPrimary: Color,
primaryContainer: Color,
onPrimaryContainer: Color,
inversePrimary: Color,
secondary: Color,
onSecondary: Color,
secondaryContainer: Color,
onSecondaryContainer: Color,
tertiary: Color,
onTertiary: Color,
tertiaryContainer: Color,
onTertiaryContainer: Color,
background: Color,
onBackground: Color,
surface: Color,
onSurface: Color,
surfaceVariant: Color,
onSurfaceVariant: Color,
surfaceTint: Color,
inverseSurface: Color,
inverseOnSurface: Color,
error: Color,
onError: Color,
errorContainer: Color,
onErrorContainer: Color,
border: Color,
borderVariant: Color,
scrim: Color,
)
A color scheme holds all the named color parameters for a MaterialTheme.
Color schemes are designed to be harmonious, ensure accessible text, and distinguish UI elements and surfaces from one another. There are two built-in baseline schemes, lightColorScheme and a darkColorScheme, that can be used as-is or customized.
The Material color system and custom schemes provide default values for color as a starting point for customization.
To learn more about colors, see Material Design colors.
- Floating action buttons
- Selection controls, like checkboxes and radio buttons
- Highlighting selected text
- Links and headlines
Properties
primary
Added in 1.1.0-rc01
var primary
onPrimary
Added in 1.1.0-rc01
var onPrimary
primaryContainer
Added in 1.1.0-rc01
var primaryContainer
onPrimaryContainer
Added in 1.1.0-rc01
var onPrimaryContainer
inversePrimary
Added in 1.1.0-rc01
var inversePrimary
secondary
Added in 1.1.0-rc01
var secondary
onSecondary
Added in 1.1.0-rc01
var onSecondary
secondaryContainer
Added in 1.1.0-rc01
var secondaryContainer
onSecondaryContainer
Added in 1.1.0-rc01
var onSecondaryContainer
tertiary
Added in 1.1.0-rc01
var tertiary
onTertiary
Added in 1.1.0-rc01
var onTertiary
tertiaryContainer
Added in 1.1.0-rc01
var tertiaryContainer
onTertiaryContainer
Added in 1.1.0-rc01
var onTertiaryContainer
background
Added in 1.1.0-rc01
var background
onBackground
Added in 1.1.0-rc01
var onBackground
surface
Added in 1.1.0-rc01
var surface
onSurface
Added in 1.1.0-rc01
var onSurface
surfaceVariant
Added in 1.1.0-rc01
var surfaceVariant
onSurfaceVariant
Added in 1.1.0-rc01
var onSurfaceVariant
surfaceTint
Added in 1.1.0-rc01
var surfaceTint
inverseSurface
Added in 1.1.0-rc01
var inverseSurface
inverseOnSurface
Added in 1.1.0-rc01
var inverseOnSurface
error
Added in 1.1.0-rc01
var error
onError
Added in 1.1.0-rc01
var onError
errorContainer
Added in 1.1.0-rc01
var errorContainer
onErrorContainer
Added in 1.1.0-rc01
var onErrorContainer
border
Added in 1.1.0-rc01
var border
borderVariant
Added in 1.1.0-rc01
var borderVariant
scrim
Added in 1.1.0-rc01
var scrim
Functions
copy
Added in 1.1.0-rc01
fun copy(
primary: Color = this.primary,
onPrimary: Color = this.onPrimary,
primaryContainer: Color = this.primaryContainer,
onPrimaryContainer: Color = this.onPrimaryContainer,
inversePrimary: Color = this.inversePrimary,
secondary: Color = this.secondary,
onSecondary: Color = this.onSecondary,
secondaryContainer: Color = this.secondaryContainer,
onSecondaryContainer: Color = this.onSecondaryContainer,
tertiary: Color = this.tertiary,
onTertiary: Color = this.onTertiary,
tertiaryContainer: Color = this.tertiaryContainer,
onTertiaryContainer: Color = this.onTertiaryContainer,
background: Color = this.background,
onBackground: Color = this.onBackground,
surface: Color = this.surface,
onSurface: Color = this.onSurface,
surfaceVariant: Color = this.surfaceVariant,
onSurfaceVariant: Color = this.onSurfaceVariant,
surfaceTint: Color = this.surfaceTint,
inverseSurface: Color = this.inverseSurface,
inverseOnSurface: Color = this.inverseOnSurface,
error: Color = this.error,
onError: Color = this.onError,
errorContainer: Color = this.errorContainer,
onErrorContainer: Color = this.onErrorContainer,
border: Color = this.border,
borderVariant: Color = this.borderVariant,
scrim: Color = this.scrim,
): ColorScheme
Returns a copy of this ColorScheme, optionally overriding some of the values.