# androidx.graphics.shapes

*** ** * ** ***

Common/AllAndroid/JVM

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/MutablePoint` | This interface is used refer to Points that can be modified, as a scope to `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/PointTransformer` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/PointTransformer` | Interface for a function that can transform (rotate/scale/translate/etc.) points. | Cmn |

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` | CornerRounding defines the amount and quality around a given vertex of a shape. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic` | This class holds the anchor and control point data for a single cubic Bézier curve, with anchor points (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor0X()`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor0Y()`) and (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor1X()`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor1Y()`) at either end and control points (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control0X()`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control0Y()`) and (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control1X()`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control1Y()`) determining the slope of the curve between the anchor points. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature` | While a polygon's shape can be drawn solely using a list of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic` objects representing its raw curves and lines, features add an extra layer of context to groups of cubics. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/FeatureSerializer` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/FeatureSerializer` is used to both serialize and parse `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature` objects. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Morph` | This class is used to animate between start and end polygons objects. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/MutableCubic` | This is a Mutable version of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic`, used mostly for performance critical paths so we can avoid creating new `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic`s | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | The RoundedPolygon class allows simple construction of polygonal shapes with optional rounding at the vertices. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/SvgPathParser` | Converts each command (beside move to) of a svg path to a list of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic`s by calling `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/SvgPathParser.Companion#parseCubics(kotlin.String)`. | Cmn |

## Objects

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature.Factory` |   | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.Companion` |   | Cmn |

## Type aliases

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/TransformResult` |   | Cmn |

## Top-level functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( anchor0X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, anchor0Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, control0X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, control0Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, control1X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, control1Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, anchor1X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, anchor1Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Create a Cubic that holds the anchor and control point data for a single Bézier curve, with anchor points (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) and (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) at either end and control points (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) and (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) determining the slope of the curve between the anchor points. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(androidx.graphics.shapes.RoundedPolygon)(source: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon)` Creates a copy of the given `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(androidx.graphics.shapes.RoundedPolygon)` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.collections.List,kotlin.Float,kotlin.Float)(features: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature>, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` This constructor takes a list of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature` objects that define the polygon's shape and curves. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)( vertices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html, rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding, perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>?, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` This function takes the vertices (either supplied or calculated, depending on the constructor called), plus `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` parameters, and creates the actual `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` shape, rounding around the vertices (or not) as specified. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)( numVertices: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 3) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, radius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding, perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>? )` This constructor takes the number of vertices in the resulting polygon. | Cmn |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.Companion.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).circle(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float)( numVertices: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 3) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, radius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Creates a circular shape, approximating the rounding of the shape around the underlying polygon vertices. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.Companion.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, smoothing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` A pill shape consists of a rectangle shape bounded by two semicircles at either of the long ends of the rectangle. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.Companion.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, numVerticesPerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, innerRadiusRatio: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false, to = 1.0, toInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding, innerRounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding?, perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>?, vertexSpacing: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, startLocation: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` A pillStar shape is like a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` except it has inner and outer radii along its pill-shaped outline, just like a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` has inner and outer radii along its circular outline. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.Companion.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).rectangle(kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)( width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding, perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>?, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Creates a rectangular shape with the given width/height around the given center. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.Companion.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)( numVerticesPerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, radius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, innerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding, innerRounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding?, perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>?, centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Creates a star polygon, which is like a regular polygon except every other vertex is on either an inner or outer radius. | Cmn |
| `https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon).toPath(android.graphics.Path)(path: https://developer.android.com/reference/android/graphics/Path.html)` Gets a `https://developer.android.com/reference/android/graphics/Path.html` representation for a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` shape. | android |
| `https://developer.android.com/reference/android/graphics/Path.html` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Morph.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.Morph).toPath(kotlin.Float,android.graphics.Path)(progress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, path: https://developer.android.com/reference/android/graphics/Path.html)` | android |
| `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon.https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon).transformed(android.graphics.Matrix)(matrix: https://developer.android.com/reference/android/graphics/Matrix.html)` Transforms a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` by the given matrix. | android |

## Top-level functions

### Cubic

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Cubic.kt+function:Cubic) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun Cubic(
    anchor0X: Float,
    anchor0Y: Float,
    control0X: Float,
    control0Y: Float,
    control1X: Float,
    control1Y: Float,
    anchor1X: Float,
    anchor1Y: Float
): Cubic
```

Create a Cubic that holds the anchor and control point data for a single Bézier curve, with anchor points (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) and (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) at either end and control points (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) and (`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#Cubic(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`) determining the slope of the curve between the anchor points.

The returned instance is immutable.

| Parameters |
|---|---|
| `anchor0X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the first anchor point x coordinate |
| `anchor0Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the first anchor point y coordinate |
| `control0X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the first control point x coordinate |
| `control0Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the first control point y coordinate |
| `control1X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the second control point x coordinate |
| `control1Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the second control point y coordinate |
| `anchor1X: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the second anchor point x coordinate |
| `anchor1Y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the second anchor point y coordinate |

### RoundedPolygon

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/RoundedPolygon.kt+function:RoundedPolygon) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon(source: RoundedPolygon): RoundedPolygon
```

Creates a copy of the given `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(androidx.graphics.shapes.RoundedPolygon)`

### RoundedPolygon

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/RoundedPolygon.kt+function:RoundedPolygon)

```
fun RoundedPolygon(
    features: List<Feature>,
    centerX: Float = Float.NaN,
    centerY: Float = Float.NaN
): RoundedPolygon
```

This constructor takes a list of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature` objects that define the polygon's shape and curves. By specifying the features directly, the summarization of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic` objects to curves can be precisely controlled. This affects `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Morph`'s default mapping, as curves with the same type (convex or concave) are mapped with each other. For example, if you have a convex curve in your start polygon, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Morph` will map it to another convex curve in the end polygon.

The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.collections.List,kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.collections.List,kotlin.Float,kotlin.Float)` parameters are optional. If not supplied, they will be estimated by calculating the average of all cubic anchor points.

| Parameters |
|---|---|
| `features: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature>` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Feature`s that describe the characteristics of each outline segment of the polygon. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | The X coordinate of the center of the polygon, around which all vertices will be placed. If none provided, the center will be averaged. |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | The Y coordinate of the center of the polygon, around which all vertices will be placed. If none provided, the center will be averaged. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.collections.List,kotlin.Float,kotlin.Float)` must be at least specify 2 features and describe a closed shape. |

### RoundedPolygon

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/RoundedPolygon.kt+function:RoundedPolygon) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon(
    vertices: FloatArray,
    rounding: CornerRounding = CornerRounding.Unrounded,
    perVertexRounding: List<CornerRounding>? = null,
    centerX: Float = Float.MIN_VALUE,
    centerY: Float = Float.MIN_VALUE
): RoundedPolygon
```

This function takes the vertices (either supplied or calculated, depending on the constructor called), plus `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` parameters, and creates the actual `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` shape, rounding around the vertices (or not) as specified. The result is a list of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic` curves which represent the geometry of the final shape.

| Parameters |
|---|---|
| `vertices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | The list of vertices in this polygon specified as pairs of x/y coordinates in this FloatArray. This should be an ordered list (with the outline of the shape going from each vertex to the next in order of this list), otherwise the results will be undefined. |
| `rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding = CornerRounding.Unrounded` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of all vertices. If some vertices should have different rounding properties, then use `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` instead. The default rounding value is `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding#Unrounded()`, meaning that the polygon will use the vertices themselves in the final shape and not curves rounded around the vertices. |
| `perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>? = null` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of all vertices. If this parameter is not null, then it must have the same size as `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`. If this parameter is null, then the polygon will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` parameter for every vertex instead. The default value is null. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.MIN_VALUE` | The X coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.MIN_VALUE` | The Y coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the number of vertices is less than 3 (the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` parameter has less than 6 Floats). Or if the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.FloatArray,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` parameter is not null and the size doesn't match the number vertices. |

### RoundedPolygon

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/RoundedPolygon.kt+function:RoundedPolygon) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon(
    numVertices: @IntRange(from = 3) Int,
    radius: Float = 1.0f,
    centerX: Float = 0.0f,
    centerY: Float = 0.0f,
    rounding: CornerRounding = CornerRounding.Unrounded,
    perVertexRounding: List<CornerRounding>? = null
): RoundedPolygon
```

This constructor takes the number of vertices in the resulting polygon. These vertices are positioned on a virtual circle around a given center with each vertex positioned `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` distance from that center, equally spaced (with equal angles between them). If no radius is supplied, the shape will be created with a default radius of 1, resulting in a shape whose vertices lie on a unit circle, with width/height of 2. That default polygon will probably need to be rescaled using `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.collection.FloatFloatPair).transformed(androidx.graphics.shapes.PointTransformer)` into the appropriate size for the UI in which it will be drawn.

The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` and `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` parameters are optional. If not supplied, the result will be a regular polygon with straight edges and unrounded corners.

| Parameters |
|---|---|
| `numVertices: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 3) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of vertices in this polygon. |
| `radius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | The radius of the polygon, in pixels. This radius determines the initial size of the object, but it can be transformed later by using the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.collection.FloatFloatPair).transformed(androidx.graphics.shapes.PointTransformer)` function. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The X coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The Y coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |
| `rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding = CornerRounding.Unrounded` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of all vertices. If some vertices should have different rounding properties, then use `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` instead. The default rounding value is `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding#Unrounded()`, meaning that the polygon will use the vertices themselves in the final shape and not curves rounded around the vertices. |
| `perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>? = null` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If this parameter is not null, then it must have `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` elements. If this parameter is null, then the polygon will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` parameter for every vertex instead. The default value is null. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` is not null and its size is not equal to `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#RoundedPolygon(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List)` must be at least 3. |

## Extension functions

### RoundedPolygon.Companion.circle

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.kt+function:circle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon.Companion.circle(
    numVertices: @IntRange(from = 3) Int = 8,
    radius: Float = 1.0f,
    centerX: Float = 0.0f,
    centerY: Float = 0.0f
): RoundedPolygon
```

Creates a circular shape, approximating the rounding of the shape around the underlying polygon vertices.

| Parameters |
|---|---|
| `numVertices: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 3) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 8` | The number of vertices in the underlying polygon with which to approximate the circle, default value is 8 |
| `radius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | optional radius for the circle, default value is 1.0 |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | X coordinate of optional center for the circle, default value is 0 |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | Y coordinate of optional center for the circle, default value is 0 |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).circle(kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Float)` must be at least 3 |

### RoundedPolygon.Companion.pill

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.kt+function:pill) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon.Companion.pill(
    width: Float = 2.0f,
    height: Float = 1.0f,
    smoothing: Float = 0.0f,
    centerX: Float = 0.0f,
    centerY: Float = 0.0f
): RoundedPolygon
```

A pill shape consists of a rectangle shape bounded by two semicircles at either of the long ends of the rectangle.

| Parameters |
|---|---|
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 2.0f` | The width of the resulting shape. |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | The height of the resulting shape. |
| `smoothing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | the amount by which the arc is "smoothed" by extending the curve from the circular arc on each endcap to the edge between the endcaps. A value of 0 (no smoothing) indicates that the corner is rounded by only a circular arc. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The X coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The Y coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if either `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` or `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` are \<= 0. |

### RoundedPolygon.Companion.pillStar

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.kt+function:pillStar) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon.Companion.pillStar(
    width: Float = 2.0f,
    height: Float = 1.0f,
    numVerticesPerRadius: Int = 8,
    innerRadiusRatio: @FloatRange(from = 0.0, fromInclusive = false, to = 1.0, toInclusive = false) Float = 0.5f,
    rounding: CornerRounding = CornerRounding.Unrounded,
    innerRounding: CornerRounding? = null,
    perVertexRounding: List<CornerRounding>? = null,
    vertexSpacing: @FloatRange(from = 0.0, to = 1.0) Float = 0.5f,
    startLocation: @FloatRange(from = 0.0, to = 1.0) Float = 0.0f,
    centerX: Float = 0.0f,
    centerY: Float = 0.0f
): RoundedPolygon
```

A pillStar shape is like a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` except it has inner and outer radii along its pill-shaped outline, just like a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` has inner and outer radii along its circular outline. The parameters for a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` are similar to those of a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` except, like `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, it has a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` to determine the general shape of the underlying pill. Also, there is a subtle complication with the way that inner and outer vertices proceed along the circular ends of the shape, depending on the magnitudes of the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, and `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` parameters. For example, a shape with outer vertices that lie along the curved end outline will necessarily have inner vertices that are closer to each other, because of the curvature of that part of the shape. Conversely, if the inner vertices are lined up along the pill outline at the ends, then the outer vertices will be much further apart from each other.

The default approach, reflected by the default value of `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, is to use the average of the outer and inner radii, such that each set of vertices falls equally to the other side of the pill outline on the curved ends. Depending on the values used for the various rounding and radius parameters, you may want to change that value to suit the look you want. A value of 0 for `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` is equivalent to aligning the inner vertices along the circular curve, and a value of 1 is equivalent to aligning the outer vertices along that curve.

| Parameters |
|---|---|
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 2.0f` | The width of the resulting shape. |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | The height of the resulting shape. |
| `numVerticesPerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 8` | The number of vertices along each of the two radii. |
| `innerRadiusRatio: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false, to = 1.0, toInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.5f` | Inner radius ratio for this star shape, must be greater than 0 and less than or equal to 1. Note that a value of 1 would be similar to creating a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pill(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`, but with more vertices. The default value is .5. |
| `rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding = CornerRounding.Unrounded` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If some vertices should have different rounding properties, then use `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` instead. The default rounding value is `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding#Unrounded()`, meaning that the polygon will use the vertices themselves in the final shape and not curves rounded around the vertices. |
| `innerRounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding? = null` | Optional rounding parameters for the vertices on the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`. If null (the default value), inner vertices will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` or `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` parameters instead. |
| `perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>? = null` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If this parameter is not null, then it must have the same size as 2 \* `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`. If this parameter is null, then the polygon will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` parameter for every vertex instead. The default value is null. |
| `vertexSpacing: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.5f` | This factor determines how the vertices on the circular ends are laid out along the outline. A value of 0 aligns spaces the inner vertices the same as those along the straight edges, with the outer vertices then being spaced further apart. A value of 1 does the opposite, with the outer vertices spaced the same as the vertices on the straight edges. The default value is .5, which takes the average of these two extremes. |
| `startLocation: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | A value from 0 to 1 which determines how far along the perimeter of this shape to start the underlying curves of which it is comprised. This is not usually needed or noticed by the user. But if the caller wants to manually and gradually stroke the path when drawing it, it might matter where that path outline begins and ends. The default value is 0. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The X coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The Y coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if either `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` or `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` are \<= 0 or if `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).pillStar(kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)` is outside the range of (0, 1\]. |

### RoundedPolygon.Companion.rectangle

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.kt+function:rectangle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon.Companion.rectangle(
    width: Float = 2.0f,
    height: Float = 2.0f,
    rounding: CornerRounding = CornerRounding.Unrounded,
    perVertexRounding: List<CornerRounding>? = null,
    centerX: Float = 0.0f,
    centerY: Float = 0.0f
): RoundedPolygon
```

Creates a rectangular shape with the given width/height around the given center. Optional rounding parameters can be used to create a rounded rectangle instead.

As with all `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` objects, if this shape is created with default dimensions and center, it is sized to fit within the 2x2 bounding box around a center of (0, 0) and will need to be scaled and moved using `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon#transformed(androidx.graphics.shapes.PointTransformer)` to fit the intended area in a UI.

| Parameters |
|---|---|
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 2.0f` | The width of the rectangle, default value is 2 |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 2.0f` | The height of the rectangle, default value is 2 |
| `rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding = CornerRounding.Unrounded` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If some vertices should have different rounding properties, then use `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).rectangle(kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` instead. The default rounding value is `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding#Unrounded()`, meaning that the polygon will use the vertices themselves in the final shape and not curves rounded around the vertices. |
| `perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>? = null` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If this parameter is not null, then it must be of size 4 for the four corners of the shape. If this parameter is null, then the polygon will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).rectangle(kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` parameter for every vertex instead. The default value is null. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The X coordinate of the center of the rectangle, around which all vertices will be placed equidistantly. The default center is at (0,0). |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The X coordinate of the center of the rectangle, around which all vertices will be placed equidistantly. The default center is at (0,0). |

### RoundedPolygon.Companion.star

Cmn Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.kt+function:star) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
fun RoundedPolygon.Companion.star(
    numVerticesPerRadius: Int,
    radius: Float = 1.0f,
    innerRadius: Float = 0.5f,
    rounding: CornerRounding = CornerRounding.Unrounded,
    innerRounding: CornerRounding? = null,
    perVertexRounding: List<CornerRounding>? = null,
    centerX: Float = 0.0f,
    centerY: Float = 0.0f
): RoundedPolygon
```

Creates a star polygon, which is like a regular polygon except every other vertex is on either an inner or outer radius. The two radii specified in the constructor must both both nonzero. If the radii are equal, the result will be a regular (not star) polygon with twice the number of vertices specified in `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`.

| Parameters |
|---|---|
| `numVerticesPerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of vertices along each of the two radii. |
| `radius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | Outer radius for this star shape, must be greater than 0. Default value is 1. |
| `innerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.5f` | Inner radius for this star shape, must be greater than 0 and less than or equal to `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`. Note that equal radii would be the same as creating a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` directly, but with 2 \* `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` vertices. Default value is .5. |
| `rounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding = CornerRounding.Unrounded` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If some vertices should have different rounding properties, then use `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` instead. The default rounding value is `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding#Unrounded()`, meaning that the polygon will use the vertices themselves in the final shape and not curves rounded around the vertices. |
| `innerRounding: https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding? = null` | Optional rounding parameters for the vertices on the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`. If null (the default value), inner vertices will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` or `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` parameters instead. |
| `perVertexRounding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding>? = null` | The `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/CornerRounding` properties of every vertex. If this parameter is not null, then it must have the same size as 2 \* `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`. If this parameter is null, then the polygon will use the `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` parameter for every vertex instead. The default value is null. |
| `centerX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The X coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |
| `centerY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The Y coordinate of the center of the polygon, around which all vertices will be placed. The default center is at (0,0). |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if either `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` or `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)` are \<= 0 or `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`\>`https://developer.android.com/reference/kotlin/androidx/graphics/shapes/package-summary#(androidx.graphics.shapes.RoundedPolygon.Companion).star(kotlin.Int,kotlin.Float,kotlin.Float,androidx.graphics.shapes.CornerRounding,androidx.graphics.shapes.CornerRounding,kotlin.collections.List,kotlin.Float,kotlin.Float)`. |

### RoundedPolygon.toPath

android Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.android.kt+function:toPath)

```
fun RoundedPolygon.toPath(path: Path = Path()): Path
```

Gets a `https://developer.android.com/reference/android/graphics/Path.html` representation for a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` shape. Note that there is some rounding happening (to the nearest thousandth), to work around rendering artifacts introduced by some points being just slightly off from each other (far less than a pixel). This also allows for a more optimal path, as redundant curves (usually a single point) can be detected and not added to the resulting path.

| Parameters |
|---|---|
| `path: https://developer.android.com/reference/android/graphics/Path.html = Path()` | an optional `https://developer.android.com/reference/android/graphics/Path.html` object which, if supplied, will avoid the function having to create a new `https://developer.android.com/reference/android/graphics/Path.html` object |

### Morph.toPath

android Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.android.kt+function:toPath)

```
fun Morph.toPath(progress: Float, path: Path = Path()): Path
```

### RoundedPolygon.transformed

android Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Shapes.android.kt+function:transformed)

```
fun RoundedPolygon.transformed(matrix: Matrix): RoundedPolygon
```

Transforms a `https://developer.android.com/reference/kotlin/androidx/graphics/shapes/RoundedPolygon` by the given matrix.

| Parameters |
|---|---|
| `matrix: https://developer.android.com/reference/android/graphics/Matrix.html` | The matrix by which the polygon is to be transformed |