public static class ColorTokens


Class holding color scheme as defined by the Wear Material3 color specification.

Summary

Constants

static final int

Static color used behind scrollable content like text, cards and buttons, not to be confused with surface (which can change through color and elevation).

static final int
ERROR = 1

Indicates remove, delete, close or dismiss actions, such as Swipe to Reveal.

static final int

Indicates errors or emergency actions, such as safety alerts.

static final int

Used for text, cards, buttons and icons shown against the background color.

static final int

Used for text and icons on the error color.

static final int

Used for text and icons on the error color.

static final int

Text and icons shown against the primary color

static final int

Contrast-passing colour shown against the primary container

static final int

Text and icons shown against the secondary color

static final int

Contrast-passing color shown against the secondary container

static final int

Text and icons shown against the surface color

static final int

On-surface variant for text and icons shown against the surface color where 3:1 contrast ratio isn’t required, a disabled state, or non-interactive icon.

static final int

Text and icons shown against the tertiary color

static final int

Contrast-passing color shown against the tertiary container

static final int
OUTLINE = 14

Subtle color used for borders like outline buttons

static final int

Outline-variant is used to define the border of a component where 3:1 contrast ratio isn’t required, a container, or a divider.

static final int
PRIMARY = 16

Main color used across screens and components

static final int

Standout container color for key components

static final int

Less prominent color, for components and screens

static final int

Accent color used across screens and components

static final int

Less prominent container color, for components like tonal buttons

static final int

Less prominent accent color, for components and screens

static final int

Container colour for tonal buttons, cards, or any component sitting above the background.

static final int

Container colour for tonal buttons, cards, or any component sitting above the background.

static final int

Container colour for tonal buttons, cards, or any component sitting above the background.

static final int

Accent color used across screens and components

static final int

Contrasting container color, for components like selection toggles and buttons

static final int

Less prominent accent color, for components and screens

Public fields

static @NonNull ColorTokens

Constants

BACKGROUND

Added in 1.3.0-alpha02
public static final int BACKGROUND = 0

Static color used behind scrollable content like text, cards and buttons, not to be confused with surface (which can change through color and elevation). For watch this is best for battery life and contrast of other colors.

ERROR

Added in 1.3.0-alpha02
public static final int ERROR = 1

Indicates remove, delete, close or dismiss actions, such as Swipe to Reveal. Added as a container alternative that is slightly less alarming and urgent than the default error color.

ERROR_CONTAINER

Added in 1.3.0-alpha02
public static final int ERROR_CONTAINER = 2

Indicates errors or emergency actions, such as safety alerts. This color is for use-cases that are more alarming and urgent than the default errorContainer color.

ON_BACKGROUND

Added in 1.3.0-alpha02
public static final int ON_BACKGROUND = 3

Used for text, cards, buttons and icons shown against the background color.

ON_ERROR

Added in 1.3.0-alpha02
public static final int ON_ERROR = 4

Used for text and icons on the error color.

ON_ERROR_CONTAINER

Added in 1.3.0-alpha02
public static final int ON_ERROR_CONTAINER = 5

Used for text and icons on the error color.

ON_PRIMARY

Added in 1.3.0-alpha02
public static final int ON_PRIMARY = 6

Text and icons shown against the primary color

ON_PRIMARY_CONTAINER

Added in 1.3.0-alpha02
public static final int ON_PRIMARY_CONTAINER = 7

Contrast-passing colour shown against the primary container

ON_SECONDARY

Added in 1.3.0-alpha02
public static final int ON_SECONDARY = 8

Text and icons shown against the secondary color

ON_SECONDARY_CONTAINER

Added in 1.3.0-alpha02
public static final int ON_SECONDARY_CONTAINER = 9

Contrast-passing color shown against the secondary container

ON_SURFACE

Added in 1.3.0-alpha02
public static final int ON_SURFACE = 10

Text and icons shown against the surface color

ON_SURFACE_VARIANT

Added in 1.3.0-alpha02
public static final int ON_SURFACE_VARIANT = 11

On-surface variant for text and icons shown against the surface color where 3:1 contrast ratio isn’t required, a disabled state, or non-interactive icon.

ON_TERTIARY

Added in 1.3.0-alpha02
public static final int ON_TERTIARY = 12

Text and icons shown against the tertiary color

ON_TERTIARY_CONTAINER

Added in 1.3.0-alpha02
public static final int ON_TERTIARY_CONTAINER = 13

Contrast-passing color shown against the tertiary container

OUTLINE

Added in 1.3.0-alpha02
public static final int OUTLINE = 14

Subtle color used for borders like outline buttons

OUTLINE_VARIANT

Added in 1.3.0-alpha02
public static final int OUTLINE_VARIANT = 15

Outline-variant is used to define the border of a component where 3:1 contrast ratio isn’t required, a container, or a divider.

PRIMARY

Added in 1.3.0-alpha02
public static final int PRIMARY = 16

Main color used across screens and components

PRIMARY_CONTAINER

Added in 1.3.0-alpha02
public static final int PRIMARY_CONTAINER = 17

Standout container color for key components

PRIMARY_DIM

Added in 1.3.0-alpha02
public static final int PRIMARY_DIM = 18

Less prominent color, for components and screens

SECONDARY

Added in 1.3.0-alpha02
public static final int SECONDARY = 19

Accent color used across screens and components

SECONDARY_CONTAINER

Added in 1.3.0-alpha02
public static final int SECONDARY_CONTAINER = 20

Less prominent container color, for components like tonal buttons

SECONDARY_DIM

Added in 1.3.0-alpha02
public static final int SECONDARY_DIM = 21

Less prominent accent color, for components and screens

SURFACE_CONTAINER

Added in 1.3.0-alpha02
public static final int SURFACE_CONTAINER = 22

Container colour for tonal buttons, cards, or any component sitting above the background.

SURFACE_CONTAINER_HIGH

Added in 1.3.0-alpha02
public static final int SURFACE_CONTAINER_HIGH = 23

Container colour for tonal buttons, cards, or any component sitting above the background. Slightly higher contrast to the background than surface. Surface variant for surface colour containing text and icons where 3:1 contrast ratio isn’t required, a disabled state, or non-interactive icon.

SURFACE_CONTAINER_LOW

Added in 1.3.0-alpha02
public static final int SURFACE_CONTAINER_LOW = 24

Container colour for tonal buttons, cards, or any component sitting above the background. Slightly lower contrast to the background than surface.

TERTIARY

Added in 1.3.0-alpha02
public static final int TERTIARY = 25

Accent color used across screens and components

TERTIARY_CONTAINER

Added in 1.3.0-alpha02
public static final int TERTIARY_CONTAINER = 26

Contrasting container color, for components like selection toggles and buttons

TERTIARY_DIM

Added in 1.3.0-alpha02
public static final int TERTIARY_DIM = 27

Less prominent accent color, for components and screens

Public fields

INSTANCE

Added in 1.3.0-alpha02
public static @NonNull ColorTokens INSTANCE