Skip to content

Most visited

Recently visited

added in version 22.1.0
belongs to Maven artifact


public final class ColorFilterCache
extends Object


Cache of ColorFilters for a given color at different alpha levels.


Public methods

static ColorFilterCache getColorFilterCache(int color)

Get a ColorDimmer for a given color.

ColorFilter getFilterForLevel(float level)

Returns a ColorFilter for a given alpha level between 0 and 1.0.

Inherited methods

From class java.lang.Object

Public methods


added in version 22.1.0
ColorFilterCache getColorFilterCache (int color)

Get a ColorDimmer for a given color. Only the RGB values are used; the alpha channel is ignored in color. Subsequent calls to this method with the same color value will return the same cache.

color int: The color to use for the color filters.

ColorFilterCache A cache of ColorFilters at different alpha levels for the color.


added in version 22.1.0
ColorFilter getFilterForLevel (float level)

Returns a ColorFilter for a given alpha level between 0 and 1.0.

level float: The alpha level the filter should apply.

ColorFilter A ColorFilter at the alpha level for the color represented by the cache.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)