Class

MeshGradientScope

A scope for configuring a mesh gradient.

Source set: Common
class MeshGradientScope(
    /** The number of patches along the vertical axis. */
    val rows: Int,
    /** The number of patches along the horizontal axis. */
    val columns: Int,
)

A scope for configuring a mesh gradient.

Use this scope to set the properties (position, color, and control points) of each vertex in the mesh grid.

Functions

setVertex

fun setVertex(
        row: Int,
        column: Int,
        position: Offset,
        color: Color,
        leftControlPoint: Offset = Offset.Unspecified,
        topControlPoint: Offset = Offset.Unspecified,
        rightControlPoint: Offset = Offset.Unspecified,
        bottomControlPoint: Offset = Offset.Unspecified,
    )

Sets the properties for a vertex at the specified row and column.

Parameters

row The row index of the vertex (0 to rows).
column The column index of the vertex (0 to columns).
position The normalized position of the vertex (0,0 to 1,1).
color The color associated with the vertex.
leftControlPoint The horizontal Bezier control point offset relative to position for the edge to the left.
topControlPoint The vertical Bezier control point offset relative to position for the edge above.
rightControlPoint The horizontal Bezier control point offset relative to position for the edge to the right.
bottomControlPoint The vertical Bezier control point offset relative to position for the edge below.

Last updated: