# ImmutableGradientBrush

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

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

```rust
struct ImmutableGradientBrush
```

The data shared by all immutable gradient brushes.

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

## Members

- [`new`](#function-new)
- [`from_brush`](#function-from_brush)
- [`gradient_stops`](#function-gradient_stops)
- [`opacity`](#function-opacity)
- [`transform`](#function-transform)
- [`transform_origin`](#function-transform_origin)
- [`spread_method`](#function-spread_method)
- [`relative_transform`](#function-relative_transform)

<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, relative_transform: Option<Rc<ImmutableTransform>>) -> Self
```

Creates the gradient brush data. `transform_origin` defaults to the
top left corner.

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

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

### from_brush

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

Creates an immutable copy of the gradient data of `source`.

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

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

### gradient_stops

```rust
fn gradient_stops(self: &Self) -> &[Rc<dyn IGradientStop>]
```

The brush's gradient stops.

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

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

### opacity

```rust
fn opacity(self: &Self) -> f64
```

The opacity of the brush.

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

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

### transform

```rust
fn transform(self: &Self) -> Option<Rc<dyn ITransform>>
```

The transform of the brush.

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

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

### transform_origin

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

The transform origin of the brush.

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

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

### spread_method

```rust
fn spread_method(self: &Self) -> GradientSpreadMethod
```

The brush's spread method.

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

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

### relative_transform

```rust
fn relative_transform(self: &Self) -> Option<Rc<dyn ITransform>>
```

The transform of the brush, relative to the bounds of the painted
area.

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

## 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>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`

## Availability

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