Skip to content

Most visited

Recently visited

navigation

ColorMatrixColorFilter

public class ColorMatrixColorFilter
extends ColorFilter

java.lang.Object
   ↳ android.graphics.ColorFilter
     ↳ android.graphics.ColorMatrixColorFilter


A color filter that transforms colors through a 4x5 color matrix. This filter can be used to change the saturation of pixels, convert from YUV to RGB, etc.

See also:

Summary

Public constructors

ColorMatrixColorFilter(ColorMatrix matrix)

Create a color filter that transforms colors through a 4x5 color matrix.

ColorMatrixColorFilter(float[] array)

Create a color filter that transforms colors through a 4x5 color matrix.

Public methods

void getColorMatrix(ColorMatrix colorMatrix)

Copies the ColorMatrix from the filter into the passed ColorMatrix.

Inherited methods

From class android.graphics.ColorFilter
From class java.lang.Object

Public constructors

ColorMatrixColorFilter

added in API level 1
ColorMatrixColorFilter (ColorMatrix matrix)

Create a color filter that transforms colors through a 4x5 color matrix.

Parameters
matrix ColorMatrix: 4x5 matrix used to transform colors. It is copied into the filter, so changes made to the matrix after the filter is constructed will not be reflected in the filter.

This value must never be null.

ColorMatrixColorFilter

added in API level 1
ColorMatrixColorFilter (float[] array)

Create a color filter that transforms colors through a 4x5 color matrix.

Parameters
array float: Array of floats used to transform colors, treated as a 4x5 matrix. The first 20 entries of the array are copied into the filter. See ColorMatrix.

This value must never be null.

Public methods

getColorMatrix

added in API level 26
void getColorMatrix (ColorMatrix colorMatrix)

Copies the ColorMatrix from the filter into the passed ColorMatrix.

Parameters
colorMatrix ColorMatrix: Set to the current value of the filter's ColorMatrix.

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

Hooray!

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 one-minute survey?
Help us improve Android tools and documentation.