MeshGradientScope


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.

Summary

Public constructors

MeshGradientScope(rows: Int, columns: Int)
Cmn

Public functions

Unit
setVertex(
    row: Int,
    column: Int,
    position: Offset,
    color: Color,
    leftControlPoint: Offset,
    topControlPoint: Offset,
    rightControlPoint: Offset,
    bottomControlPoint: Offset
)

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

Cmn

Public properties

Int

The number of patches along the horizontal axis.

Cmn
Int

The number of patches along the vertical axis.

Cmn

Public constructors

MeshGradientScope

MeshGradientScope(rows: Int, columns: Int)

Public 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
): Unit

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

Parameters
row: Int

The row index of the vertex (0 to rows).

column: Int

The column index of the vertex (0 to columns).

position: Offset

The normalized position of the vertex (0,0 to 1,1).

color: Color

The color associated with the vertex.

leftControlPoint: Offset = Offset.Unspecified

The horizontal Bezier control point offset relative to position for the edge to the left.

topControlPoint: Offset = Offset.Unspecified

The vertical Bezier control point offset relative to position for the edge above.

rightControlPoint: Offset = Offset.Unspecified

The horizontal Bezier control point offset relative to position for the edge to the right.

bottomControlPoint: Offset = Offset.Unspecified

The vertical Bezier control point offset relative to position for the edge below.

Public properties

columns

val columnsInt

The number of patches along the horizontal axis.

rows

val rowsInt

The number of patches along the vertical axis.