Android 12 Developer Preview is here! Try it out, and give us your feedback!

ShaderBrush

@Immutable abstract class ShaderBrush : Brush
kotlin.Any
   ↳ androidx.compose.ui.graphics.Brush
   ↳ androidx.compose.ui.graphics.ShaderBrush

Brush implementation that wraps and applies a the provided shader to a Paint The shader can be lazily created based on a given size, or provided directly as a parameter

Summary

Public constructors

Brush implementation that wraps and applies a the provided shader to a Paint The shader can be lazily created based on a given size, or provided directly as a parameter

Public methods
Unit
applyTo(size: Size, p: Paint, alpha: Float)

abstract Shader

Public constructors

<init>

ShaderBrush()

Brush implementation that wraps and applies a the provided shader to a Paint The shader can be lazily created based on a given size, or provided directly as a parameter

Public methods

applyTo

fun applyTo(
    size: Size,
    p: Paint,
    alpha: Float
): Unit

createShader

abstract fun createShader(size: Size): Shader