SurfaceColors

public enum SurfaceColors


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

Summary

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

Returns the enum constant of this type with the specified name.

static SurfaceColors[]

Returns an array containing the constants of this enum type, in the order they're declared.

Public methods

getColor

public int getColor(Context context)

Returns the tonal surface color value in RGB.

getColorForElevation

public static int getColorForElevation(Context context, float elevation)

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

valueOf

public static SurfaceColors valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Returns
SurfaceColors

the enum constant with the specified name

Throws
java.lang.IllegalArgumentException

if this enum type has no constant with the specified name

values

public static SurfaceColors[] values()

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

Returns
SurfaceColors[]

an array containing the constants of this enum type, in the order they're declared