# CornerRadius

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/struct-cornerradius/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct CornerRadius
```

Represents the radii of a rectangle's corners.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L12)

## Members

- [`top_left`](#struct_field-top_left)
- [`top_right`](#struct_field-top_right)
- [`bottom_right`](#struct_field-bottom_right)
- [`bottom_left`](#struct_field-bottom_left)
- [`new`](#function-new)
- [`uniform`](#function-uniform)
- [`top_bottom`](#function-top_bottom)
- [`is_uniform`](#function-is_uniform)
- [`equals`](#function-equals)
- [`parse`](#function-parse)

<a id="struct_field-top_left"></a>

### top_left

```rust
top_left: f64
```

Radius of the top left corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L14)

<a id="struct_field-top_right"></a>

### top_right

```rust
top_right: f64
```

Radius of the top right corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L16)

<a id="struct_field-bottom_right"></a>

### bottom_right

```rust
bottom_right: f64
```

Radius of the bottom right corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L18)

<a id="struct_field-bottom_left"></a>

### bottom_left

```rust
bottom_left: f64
```

Radius of the bottom left corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L20)

<a id="function-new"></a>

### new

```rust
const fn new(top_left: f64, top_right: f64, bottom_right: f64, bottom_left: f64) -> Self
```

Initializes a `CornerRadius` from the four corner radii, clockwise from the top left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L26)

<a id="function-uniform"></a>

### uniform

```rust
const fn uniform(uniform_radius: f64) -> Self
```

Initializes a `CornerRadius` with the same radius on every corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L37)

<a id="function-top_bottom"></a>

### top_bottom

```rust
const fn top_bottom(top: f64, bottom: f64) -> Self
```

Initializes a `CornerRadius` from the radius of the top corners and the
radius of the bottom corners.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L49)

<a id="function-is_uniform"></a>

### is_uniform

```rust
fn is_uniform(self: &Self) -> bool
```

Gets a value indicating whether the instance has equal values for all
corners (NaN compares equal to NaN here).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L56)

<a id="function-equals"></a>

### equals

```rust
fn equals(self: &Self, other: CornerRadius) -> bool
```

Returns a boolean indicating whether the corner radius is equal to the other
given corner radius (exact comparison).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L65)

<a id="function-parse"></a>

### parse

```rust
fn parse(s: &str) -> Result<Self, FormatError>
```

Parses a `CornerRadius` string: one, two or four numbers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/corner_radius.rs#L73)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- [`Transition<CornerRadius>`](/docs/0.5.0/api/ferroui-base/animation/trait-transition/)
- `ServerPropertyValue`
- `BatchValue`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- `FromStr`
- `Display`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
