# ImmutableLinearGradientBrush

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

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

```rust
struct ImmutableLinearGradientBrush
```

A brush that draws with a linear gradient.

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

## Members

- [`new`](#function-new)
- [`from_stops`](#function-from_stops)
- [`from_brush`](#function-from_brush)
- [`start_point`](#function-start_point)
- [`end_point`](#function-end_point)

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

Creates a brush. `transform_origin` defaults to the top left corner,
`start_point` to the top left and `end_point` to the bottom right.

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

<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_linear_gradient_brush.rs#L51)

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

### from_brush

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

Creates an immutable copy of `source`.

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

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

### start_point

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

The start point for the gradient.

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

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

### end_point

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

The end point for the gradient.

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

## 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/)
- [`ILinearGradientBrush`](/docs/0.5.0/api/ferroui-base/media/trait-ilineargradientbrush/)

## Availability

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