MaterialColors

data class MaterialColors
kotlin.Any
   ↳ androidx.ui.material.MaterialColors

Data class holding color values as defined by the Material color specification.

Summary

Public constructors

<init>(primary: Color = Color(0xFF6200EE), primaryVariant: Color = Color(0xFF3700B3), secondary: Color = Color(0xFF03DAC6), secondaryVariant: Color = Color(0xFF018786), background: Color = Color.White, surface: Color = Color.White, error: Color = Color(0xFFB00020), onPrimary: Color = Color.White, onSecondary: Color = Color.Black, onBackground: Color = Color.Black, onSurface: Color = Color.Black, onError: Color = Color.White)

Data class holding color values as defined by the Material color specification.

Properties

Color

The background color appears behind scrollable content.

Color

The error color is used to indicate error within components, such as text fields.

Color

Color used for text and icons displayed on top of the background color.

Color

Color used for text and icons displayed on top of the error color.

Color

Color used for text and icons displayed on top of the primary color.

Color

Color used for text and icons displayed on top of the secondary color.

Color

Color used for text and icons displayed on top of the surface color.

Color

The primary color is the color displayed most frequently across your app’s screens and components.

Color

The primary variant color is used to distinguish two elements of the app using the primary color, such as the top app bar and the system bar.

Color

The secondary color provides more ways to accent and distinguish your product.

Color

The secondary variant color is used to distinguish two elements of the app using the secondary color.

Color

The surface color is used on surfaces of components, such as cards, sheets and menus.

Public constructors

<init>

MaterialColors(
    primary: Color = Color(0xFF6200EE),
    primaryVariant: Color = Color(0xFF3700B3),
    secondary: Color = Color(0xFF03DAC6),
    secondaryVariant: Color = Color(0xFF018786),
    background: Color = Color.White,
    surface: Color = Color.White,
    error: Color = Color(0xFFB00020),
    onPrimary: Color = Color.White,
    onSecondary: Color = Color.Black,
    onBackground: Color = Color.Black,
    onSurface: Color = Color.Black,
    onError: Color = Color.White)

Data class holding color values as defined by the Material color specification.

Properties

background

val background: Color

The background color appears behind scrollable content.

error

val error: Color

The error color is used to indicate error within components, such as text fields.

onBackground

val onBackground: Color

Color used for text and icons displayed on top of the background color.

onError

val onError: Color

Color used for text and icons displayed on top of the error color.

onPrimary

val onPrimary: Color

Color used for text and icons displayed on top of the primary color.

onSecondary

val onSecondary: Color

Color used for text and icons displayed on top of the secondary color.

onSurface

val onSurface: Color

Color used for text and icons displayed on top of the surface color.

primary

val primary: Color

The primary color is the color displayed most frequently across your app’s screens and components.

primaryVariant

val primaryVariant: Color

The primary variant color is used to distinguish two elements of the app using the primary color, such as the top app bar and the system bar.

secondary

val secondary: Color

The secondary color provides more ways to accent and distinguish your product. Secondary colors are best for:

  • Floating action buttons
  • Selection controls, like sliders and switches
  • Highlighting selected text
  • Progress bars
  • Links and headlines

secondaryVariant

val secondaryVariant: Color

The secondary variant color is used to distinguish two elements of the app using the secondary color.

surface

val surface: Color

The surface color is used on surfaces of components, such as cards, sheets and menus.