ColorPalette

interface ColorPalette
androidx.ui.material.ColorPalette

Collection of colors in the Material color specification

To create a light set of colors, use lightColorPalette To create a dark set of colors, use darkColorPalette

Summary

Extension functions

From androidx.ui.material
Color?

Tries to match color to a color in this ColorPalette, and then returns the corresponding on color.

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Properties

abstract Color

The background color appears behind scrollable content.

abstract Color

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

abstract Boolean

Whether this ColorPalette is considered as a 'light' or 'dark' set of colors.

abstract Color

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

abstract Color

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

abstract Color

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

abstract Color

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

abstract Color

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

abstract Color

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

abstract 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.

abstract Color

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

abstract Color

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

abstract Color

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

Properties

background

abstract val background: Color

The background color appears behind scrollable content.

error

abstract val error: Color

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

isLight

abstract val isLight: Boolean

Whether this ColorPalette is considered as a 'light' or 'dark' set of colors. This affects default behavior for some components: for example, in a light theme a TopAppBar will use primary by default for its background color, when in a dark theme it will use surface.

onBackground

abstract val onBackground: Color

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

onError

abstract val onError: Color

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

onPrimary

abstract val onPrimary: Color

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

onSecondary

abstract val onSecondary: Color

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

onSurface

abstract val onSurface: Color

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

primary

abstract val primary: Color

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

primaryVariant

abstract 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

abstract 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

abstract val secondaryVariant: Color

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

surface

abstract val surface: Color

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