# CornerRadius

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

  ```
  value class CornerRadius
  ```

*** ** * ** ***

A radius for either circular or elliptical (oval) shapes.

Note consumers should create an instance of this class through the corresponding function constructor as it is represented as an inline class with 2 float parameters packed into a single long to reduce allocation overhead

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#Zero()` A radius with `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` values set to zero. | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#CornerRadius(kotlin.Long)(packedValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` | Cmn |

| ### Public functions |
|---|---|---|
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#component1()()` | Cmn |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#component2()()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#copy(kotlin.Float,kotlin.Float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns a copy of this Radius instance optionally overriding the radius parameter for the x or y axis | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#div(kotlin.Float)(operand: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Division operator. | Cmn |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#isCircular()()` Whether this corner radius describes a quarter circle (x == y). | Cmn |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#isZero()()` Whether this corner radius is 0 in x, y, or both. | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#minus(androidx.compose.ui.geometry.CornerRadius)(other: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius)` Binary subtraction operator. | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#plus(androidx.compose.ui.geometry.CornerRadius)(other: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius)` Binary addition operator. | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#times(kotlin.Float)(operand: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Multiplication operator. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#toString()()` | Cmn |
| `inline operator https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#unaryMinus()()` Unary negation operator. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#packedValue()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` The radius value on the horizontal axis. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` The radius value on the vertical axis. | Cmn |

## Public companion properties

### Zero

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

```
val Zero: CornerRadius
```

A radius with `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` values set to zero.

You can use `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#Zero()` with `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect` to have right-angle corners.

## Public constructors

### CornerRadius

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

```
CornerRadius(packedValue: Long)
```

## Public functions

### component1

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

```
inline operator fun component1(): Float
```

### component2

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

```
inline operator fun component2(): Float
```

### copy

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

```
fun copy(
    x: Float = unpackFloat1(packedValue),
    y: Float = unpackFloat2(packedValue)
): CornerRadius
```

Returns a copy of this Radius instance optionally overriding the radius parameter for the x or y axis

### div

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

```
operator fun div(operand: Float): CornerRadius
```

Division operator.

Returns a radius whose coordinates are the coordinates of the left-hand-side operand (a radius) divided by the scalar right-hand-side operand (a Float).

### isCircular

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

```
inline fun isCircular(): Boolean
```

Whether this corner radius describes a quarter circle (x == y).

### isZero

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

```
inline fun isZero(): Boolean
```

Whether this corner radius is 0 in x, y, or both.

### minus

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

```
operator fun minus(other: CornerRadius): CornerRadius
```

Binary subtraction operator.

Returns a radius whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` value is the left-hand-side operand's `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` minus the right-hand-side operand's `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` and whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` value is the left-hand-side operand's `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` minus the right-hand-side operand's `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()`.

### plus

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

```
operator fun plus(other: CornerRadius): CornerRadius
```

Binary addition operator.

Returns a radius whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` value is the sum of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#x()` values of the two operands, and whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` value is the sum of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius#y()` values of the two operands.

### times

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

```
operator fun times(operand: Float): CornerRadius
```

Multiplication operator.

Returns a radius whose coordinates are the coordinates of the left-hand-side operand (a radius) multiplied by the scalar right-hand-side operand (a Float).

### toString

Cmn

```
open fun toString(): String
```

### unaryMinus

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

```
inline operator fun unaryMinus(): CornerRadius
```

Unary negation operator.

Returns a Radius with the distances negated.

Radiuses with negative values aren't geometrically meaningful, but could occur as part of expressions. For example, negating a radius of one pixel and then adding the result to another radius is equivalent to subtracting a radius of one pixel from the other.

## Public properties

### packedValue

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

```
val packedValue: Long
```

### x

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

```
val x: Float
```

The radius value on the horizontal axis.

### y

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

```
val y: Float
```

The radius value on the vertical axis.