ColorContrastOptions

public class ColorContrastOptions
extends Object

java.lang.Object
   ↳ com.google.android.material.color.ColorContrastOptions


Wrapper class for specifying color contrast options when applying contrast to branded and custom themes. Clients have the options to provide theme overlay resource ids for medium and high contrast mode.

An example of the provided theme overlay resource ids could be one of the following:

  • contrast in light mode: R.style.ThemeOverlay_XxxContrast_Light
  • contrast in dark mode: R.style.ThemeOverlay_XxxContrast_Dark
  • contrast in both light and dark mode: R.style.ThemeOverlay_XxxContrast_DayNight

Summary

Nested classes

class ColorContrastOptions.Builder

Builder class for specifying options when applying contrast. 

Public methods

int getHighContrastThemeOverlay()

Returns the resource id of the high contrast theme overlay.

int getMediumContrastThemeOverlay()

Returns the resource id of the medium contrast theme overlay.

Inherited methods

Public methods

getHighContrastThemeOverlay

public int getHighContrastThemeOverlay ()

Returns the resource id of the high contrast theme overlay.

Returns
int

getMediumContrastThemeOverlay

public int getMediumContrastThemeOverlay ()

Returns the resource id of the medium contrast theme overlay.

Returns
int