# CompositionLinearGradientBrush

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/brushes/struct-compositionlineargradientbrush/

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

```rust
struct CompositionLinearGradientBrush
```

A composition brush that paints with a linear gradient.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_brush.rs#L827)

## Members

- [`from_brush`](#function-from_brush)
- [`start_point`](#function-start_point)
- [`set_start_point`](#function-set_start_point)
- [`end_point`](#function-end_point)
- [`set_end_point`](#function-set_end_point)
- [`start_point_vector`](#function-start_point_vector)
- [`set_start_point_vector`](#function-set_start_point_vector)
- [`end_point_vector`](#function-end_point_vector)
- [`set_end_point_vector`](#function-set_end_point_vector)

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

### from_brush

```rust
fn from_brush(brush: &Rc<CompositionBrush>) -> Option<CompositionLinearGradientBrush>
```

The handle of `brush` as this class, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_brush.rs#L827)

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

### start_point

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_brush.rs#L836)

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

### set_start_point

```rust
fn set_start_point(self: &Self, value: RelativePoint)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_brush.rs#L840)

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

### end_point

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_brush.rs#L844)

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

### set_end_point

```rust
fn set_end_point(self: &Self, value: RelativePoint)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_brush.rs#L848)

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

### start_point_vector

```rust
fn start_point_vector(self: &Self) -> Vector
```

`StartPoint` as a WinUI `Vector2`, in the unit of the mapping mode
(default `(0, 0)`). The upstream member is
`start_point`.

Deviation (winui-composition.md): animations target the upstream
`StartPoint` (a relative point), not a `Vector2`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_gradient_winui.rs#L199)

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

### set_start_point_vector

```rust
fn set_start_point_vector(self: &Self, value: Vector)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_gradient_winui.rs#L203)

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

### end_point_vector

```rust
fn end_point_vector(self: &Self) -> Vector
```

`EndPoint` as a WinUI `Vector2`, in the unit of the mapping mode.

Deviation (winui-composition.md): the default is the one of the
upstream brush, `(0, 0)`, not the `(1, 0)` of WinUI.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_gradient_winui.rs#L211)

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

### set_end_point_vector

```rust
fn set_end_point_vector(self: &Self, value: Vector)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/brushes/composition_gradient_winui.rs#L215)

## 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`

## Availability

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