---
title: "MeshGradientScope"
description: "A scope for configuring a mesh gradient."
type: "class"
lastmod: "2026-05-08T01:17:03.049253Z"
---
## API Reference

> Source set: Common

```kotlin
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

```kotlin
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](/jetpack-compose/androidx.compose.foundation/foundation-layout/composable-functions/Row) and [column](/jetpack-compose/androidx.compose.foundation/foundation-layout/composable-functions/Column).

#### Parameters

| | |
| --- | --- |
| row | The row index of the vertex (0 to [rows](/jetpack-compose/androidx.compose.foundation/foundation-layout/functions/rows)). |
| column | The column index of the vertex (0 to [columns](/jetpack-compose/androidx.compose.foundation/foundation-layout/functions/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. |
