Colors

Class

Common
class Colors(
    primary: Color,
    primaryVariant: Color,
    secondary: Color,
    secondaryVariant: Color,
    background: Color,
    surface: Color,
    error: Color,
    onPrimary: Color,
    onSecondary: Color,
    onBackground: Color,
    onSurface: Color,
    onError: Color,
    isLight: Boolean,
)

Material Design color system(https://material.io/design/color/the-color-system.html)

The Material Design color system can help you create a color theme that reflects your brand or style.

!Color image(https://developer.android.com/images/reference/androidx/compose/material/color.png)

To create a light set of colors using the baseline values, use lightColors To create a dark set of colors using the baseline values, use darkColors

  • Floating action buttons
  • Selection controls, like checkboxes and radio buttons
  • Highlighting selected text
  • Links and headlines

Properties

Common
var primary
Common
var primaryVariant
Common
var secondary
Common
var secondaryVariant
Common
var background
Common
var surface
Common
var error
Common
var onPrimary
Common
var onSecondary
Common
var onBackground
Common
var onSurface
Common
var onError
Common
var isLight

Functions

fun copy(
        primary: Color = this.primary,
        primaryVariant: Color = this.primaryVariant,
        secondary: Color = this.secondary,
        secondaryVariant: Color = this.secondaryVariant,
        background: Color = this.background,
        surface: Color = this.surface,
        error: Color = this.error,
        onPrimary: Color = this.onPrimary,
        onSecondary: Color = this.onSecondary,
        onBackground: Color = this.onBackground,
        onSurface: Color = this.onSurface,
        onError: Color = this.onError,
        isLight: Boolean = this.isLight,
    ): Colors

Returns a copy of this Colors, optionally overriding some of the values.