# Vertices

Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/Vertices.kt+class:androidx.compose.ui.graphics.Vertices) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class Vertices
  ```

*** ** * ** ***

A set of vertex data used by `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#drawVertices(androidx.compose.ui.graphics.Vertices,androidx.compose.ui.graphics.BlendMode,androidx.compose.ui.graphics.Paint)`.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#Vertices(androidx.compose.ui.graphics.VertexMode,kotlin.FloatArray,kotlin.FloatArray,kotlin.IntArray,kotlin.ShortArray)( vertexMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/VertexMode, positions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html, textureCoordinates: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html, colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html, indices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-short-array/index.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices` instance from the arrays. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#Vertices(androidx.compose.ui.graphics.VertexMode,kotlin.collections.List,kotlin.collections.List,kotlin.collections.List,kotlin.collections.List)( vertexMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/VertexMode, positions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset>, textureCoordinates: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset>, colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color>, indices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html> )` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#colors()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-short-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#indices()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#positions()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#textureCoordinates()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/VertexMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices#vertexMode()` | Cmn |

## Public constructors

### Vertices

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
Vertices(
    vertexMode: VertexMode,
    positions: FloatArray,
    textureCoordinates: FloatArray,
    colors: IntArray,
    indices: ShortArray
)
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices` instance from the arrays. For performance reasons, this constructor does not make defensive copies of the provided arrays, instead uses them directly. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Vertices` instance takes full ownership of the provided raw data. The caller must **not** mutate these arrays after this instance is created, as modifying the data may lead to unpredictable rendering behavior.

| Parameters |
|---|---|
| `vertexMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/VertexMode` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/VertexMode` used to draw the vertices. |
| `positions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` of x, y pairs representing vertex positions. |
| `textureCoordinates: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` of u, v pairs representing texture coordinates. |
| `colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html` | An `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html` of ARGB colors for each vertex. |
| `indices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-short-array/index.html` | A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-short-array/index.html` of indices into the positions (texture, color) array. |

### Vertices

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
Vertices(
    vertexMode: VertexMode,
    positions: List<Offset>,
    textureCoordinates: List<Offset>,
    colors: List<Color>,
    indices: List<Int>
)
```

## Public properties

### colors

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val colors: IntArray
```

### indices

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val indices: ShortArray
```

### positions

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val positions: FloatArray
```

### textureCoordinates

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val textureCoordinates: FloatArray
```

### vertexMode

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val vertexMode: VertexMode
```