androidx.compose.ui.graphics

ColorFilter

Class · from org.jetbrains.compose.ui:ui-graphics:1.12.2

No hand-written docs yet.

Effect used to modify the color of each pixel drawn on a Paint that it is installed on

open class ColorFilter

Kinds of ColorFilter

Anywhere a ColorFilter is expected, you can pass any of these.

How to get one

Ready-made values and functions that return it

Used by

Parameters that take a ColorFilter.

Functions

tint

fun tint(
    color: Color,
    blendMode: BlendMode = BlendMode.SrcIn,
): ColorFilter

Creates a color filter that applies the blend mode given as the second argument. The source color is the one given as the first argument, and the destination color is the one from the layer being composited.

colorMatrix

fun colorMatrix(colorMatrix: ColorMatrix): ColorFilter

Create a ColorFilter 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.

lighting

fun lighting(multiply: Color, add: Color): ColorFilter

Create a ColorFilter that can be used to simulate simple lighting effects. A lighting ColorFilter is defined by two parameters, one used to multiply the source color and one used to add to the source color

Library docs

Effect used to modify the color of each pixel drawn on a Paint that it is installed on