SurfaceColors

public final enum SurfaceColors
extends Enum<SurfaceColors>

java.lang.Object
   ↳ java.lang.Enum<com.google.android.material.elevation.SurfaceColors>
     ↳ com.google.android.material.elevation.SurfaceColors


Provides a convenient way to get color values of tonal variations of R.attr.colorSurface.

Summary

Enum values

SurfaceColors  SURFACE_0

 

SurfaceColors  SURFACE_1

 

SurfaceColors  SURFACE_2

 

SurfaceColors  SURFACE_3

 

SurfaceColors  SURFACE_4

 

SurfaceColors  SURFACE_5

 

Public methods

int getColor(Context context)

Returns the tonal surface color value in RGB.

static int getColorForElevation(Context context, float elevation)

Returns the corresponding surface color in RGB with the given elevation.

static SurfaceColors valueOf(String name)
static final SurfaceColors[] values()

Inherited methods

Enum values

SURFACE_0

public static final SurfaceColors SURFACE_0

SURFACE_1

public static final SurfaceColors SURFACE_1

SURFACE_2

public static final SurfaceColors SURFACE_2

SURFACE_3

public static final SurfaceColors SURFACE_3

SURFACE_4

public static final SurfaceColors SURFACE_4

SURFACE_5

public static final SurfaceColors SURFACE_5

Public methods

getColor

public int getColor (Context context)

Returns the tonal surface color value in RGB.

Parameters
context Context

Returns
int

getColorForElevation

public static int getColorForElevation (Context context, 
                float elevation)

Returns the corresponding surface color in RGB with the given elevation.

Parameters
context Context

elevation float

Returns
int

valueOf

public static SurfaceColors valueOf (String name)

Parameters
name String

Returns
SurfaceColors

values

public static final SurfaceColors[] values ()

Returns
SurfaceColors[]