ComponentShader

class ComponentShader(component: Component, componentSizeDp: Float, checkeredArrangement: Boolean = true, tileXMode: Shader.TileMode = Shader.TileMode.REPEAT, tileYMode: Shader.TileMode = tileXMode) : CacheableDynamicShader

ComponentShader creates a Shader out of the provided component.

Constructors

Link copied to clipboard
constructor(component: Component, componentSizeDp: Float, checkeredArrangement: Boolean = true, tileXMode: Shader.TileMode = Shader.TileMode.REPEAT, tileYMode: Shader.TileMode = tileXMode)

Functions

Link copied to clipboard
open override fun createShader(context: DrawContext, left: Float, top: Float, right: Float, bottom: Float): Shader

Called when new instance of Shader must be created, as the left, top, right, and bottom bounds have changed or there is no cached Shader.

Link copied to clipboard
open override fun getColorAt(point: Point, context: DrawContext, bounds: RectF): Int

Gets the color of the pixel at the given point. bounds specifies the shaded area.

Link copied to clipboard
open override fun provideShader(context: DrawContext, left: Float, top: Float, right: Float, bottom: Float): Shader

Creates a Shader by using the provided left, top, right, and bottom bounds.

open fun provideShader(context: DrawContext, bounds: RectF): Shader

Creates a Shader by using the provided bounds.