# GradientBrush

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

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

```rust
struct GradientBrush
```

Base class for brushes that draw with a gradient.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`to_immutable`](#function-to_immutable)
- [`spread_method_property`](#function-spread_method_property)
- [`gradient_stops_property`](#function-gradient_stops_property)
- [`construct`](#function-construct)
- [`spread_method`](#function-spread_method)
- [`set_spread_method`](#function-set_spread_method)
- [`gradient_stops`](#function-gradient_stops)
- [`set_gradient_stops`](#function-set_gradient_stops)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<GradientBrush>
```

Returns a strong reference to this object.

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

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

### to_immutable

```rust
fn to_immutable(self: &Self) -> Rc<dyn IImmutableBrush>
```

Creates an immutable clone of the brush.

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

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

### spread_method_property

```rust
fn spread_method_property() -> &'static StyledProperty<GradientSpreadMethod>
```



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

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

### gradient_stops_property

```rust
fn gradient_stops_property() -> &'static StyledProperty<Option<GradientStops>>
```



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

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

### construct

```rust
fn construct() -> Self
```

Creates the class data.

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

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

### spread_method

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

The brush's spread method that defines how to draw a gradient that
doesn't fill the bounds of the destination control.

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

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

### set_spread_method

```rust
fn set_spread_method(self: &Self, value: GradientSpreadMethod)
```



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

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

### gradient_stops

```rust
fn gradient_stops(self: &Self) -> GradientStops
```

The brush's gradient stops. Panics if the property has been cleared.

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

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

### set_gradient_stops

```rust
fn set_gradient_stops(self: &Self, value: GradientStops)
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`BrushImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-brushimplext/)
- [`GradientBrushImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-gradientbrushimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<GradientBrush>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`BrushImpl`](/docs/0.5.0/api/ferroui-base/media/trait-brushimpl/)
- [`GradientBrushImpl`](/docs/0.5.0/api/ferroui-base/media/trait-gradientbrushimpl/)

## Availability

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