# ImmutableRadialGradientBrush

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/immutable/struct-immutableradialgradientbrush/

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

```rust
struct ImmutableRadialGradientBrush
```

A brush that draws with a radial gradient.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L9)

## Members

- [`new`](#function-new)
- [`with_radius`](#function-with_radius)
- [`from_stops`](#function-from_stops)
- [`from_brush`](#function-from_brush)
- [`center`](#function-center)
- [`gradient_origin`](#function-gradient_origin)
- [`radius_x`](#function-radius_x)
- [`radius_y`](#function-radius_y)

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

### new

```rust
fn new(gradient_stops: &[ImmutableGradientStop], opacity: f64, transform: Option<Rc<ImmutableTransform>>, transform_origin: Option<RelativePoint>, spread_method: GradientSpreadMethod, center: Option<RelativePoint>, gradient_origin: Option<RelativePoint>, radius_x: Option<RelativeScalar>, radius_y: Option<RelativeScalar>, relative_transform: Option<Rc<ImmutableTransform>>) -> Self
```

Creates a brush. `transform_origin` defaults to the top left corner,
`center` and `gradient_origin` to the center and the radii to one
half, relative.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L28)

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

### with_radius

```rust
fn with_radius(gradient_stops: &[ImmutableGradientStop], opacity: f64, transform: Option<Rc<ImmutableTransform>>, transform_origin: Option<RelativePoint>, spread_method: GradientSpreadMethod, center: Option<RelativePoint>, gradient_origin: Option<RelativePoint>, radius: f64) -> Self
```

Creates a brush whose radii are both `radius`, relative to the
painted area.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L59)

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

### from_stops

```rust
fn from_stops(gradient_stops: &[ImmutableGradientStop]) -> Self
```

Creates a fully opaque brush with the given stops and default values
for everything else.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L85)

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

### from_brush

```rust
fn from_brush(source: &RadialGradientBrush) -> Self
```

Creates an immutable copy of `source`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L90)

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

### center

```rust
fn center(self: &Self) -> RelativePoint
```

The start point for the gradient.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L103)

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

### gradient_origin

```rust
fn gradient_origin(self: &Self) -> RelativePoint
```

The location of the two-dimensional focal point that defines the
beginning of the gradient.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L110)

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

### radius_x

```rust
fn radius_x(self: &Self) -> RelativeScalar
```

The horizontal radius of the outermost circle of the radial gradient.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L116)

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

### radius_y

```rust
fn radius_y(self: &Self) -> RelativeScalar
```

The vertical radius of the outermost circle of the radial gradient.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/immutable/immutable_radial_gradient_brush.rs#L122)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`
- [`IBrush`](/docs/0.5.0/api/ferroui-base/media/trait-ibrush/)
- [`IGradientBrush`](/docs/0.5.0/api/ferroui-base/media/trait-igradientbrush/)
- [`IImmutableBrush`](/docs/0.5.0/api/ferroui-base/media/trait-iimmutablebrush/)
- [`IRadialGradientBrush`](/docs/0.5.0/api/ferroui-base/media/trait-iradialgradientbrush/)

## Availability

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