# PaintMotion

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/paint/struct-paintmotion/

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

```rust
struct PaintMotion
```

A paint's timeline is independent of geometries referring to its brush.
Read it once per host frame and reuse its snapshot for all those geometries.

Source names (`Color`, `GradientStops`, `ColorPos`, `StartPoint`, `EndPoint`,
`Center`, `Radius`, `StrokeThickness`, `StrokeMiter`) are registered directly.
`ColorPos` is `Option<Vec<f64>>`; `None` retains source evenly spaced stops.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L138)

## Members

- [`brush_space`](#struct_field-brush_space)
- [`DEFAULT_START_POINT`](#assoc_const-default_start_point)
- [`DEFAULT_END_POINT`](#assoc_const-default_end_point)
- [`solid`](#function-solid)
- [`solid_with_stroke`](#function-solid_with_stroke)
- [`linear`](#function-linear)
- [`linear_with_points`](#function-linear_with_points)
- [`radial`](#function-radial)
- [`radial_with_center`](#function-radial_with_center)
- [`from_brush`](#function-from_brush)
- [`kind`](#function-kind)
- [`animatable`](#function-animatable)
- [`animatable_mut`](#function-animatable_mut)
- [`is_valid`](#function-is_valid)
- [`set_transition`](#function-set_transition)
- [`complete_transition`](#function-complete_transition)
- [`remove_transition`](#function-remove_transition)
- [`set`](#function-set)
- [`get`](#function-get)
- [`sample`](#function-sample)
- [`clone_snapshot`](#function-clone_snapshot)
- [`clear_cache`](#function-clear_cache)

<a id="struct_field-brush_space"></a>

### brush_space

```rust
brush_space: super::BrushSpace
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L145)

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

### DEFAULT_START_POINT

```rust
const DEFAULT_START_POINT: Point
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L163)

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

### DEFAULT_END_POINT

```rust
const DEFAULT_END_POINT: Point
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L164)

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

### solid

```rust
fn solid(color: Color) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L195)

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

### solid_with_stroke

```rust
fn solid_with_stroke(color: Color, stroke_width: f64) -> Result<Self, PaintError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L200)

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

### linear

```rust
fn linear(gradient_stops: Vec<Color>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L207)

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

### linear_with_points

```rust
fn linear_with_points(gradient_stops: Vec<Color>, start: Point, end: Point, color_positions: Option<Vec<f64>>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L215)

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

### radial

```rust
fn radial(gradient_stops: Vec<Color>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L233)

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

### radial_with_center

```rust
fn radial_with_center(gradient_stops: Vec<Color>, center: Point, radius: f64, color_positions: Option<Vec<f64>>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L236)

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

### from_brush

```rust
fn from_brush(brush: Rc<dyn IBrush>) -> Self
```

Freezes the supplied native brush, preserving its coordinate units,
transforms, opacity, spread and independent radial focal point/radii.
Custom brush kinds remain a motionless `Brush` state property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L265)

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

### kind

```rust
fn kind(self: &Self) -> PaintKind
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L367)

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

### animatable

```rust
fn animatable(self: &Self) -> &Animatable
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L370)

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

### animatable_mut

```rust
fn animatable_mut(self: &mut Self) -> &mut Animatable
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L373)

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

### is_valid

```rust
fn is_valid(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L376)

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

### set_transition

```rust
fn set_transition(self: &mut Self, animation: Option<Animation>, properties: &[&str]) -> Result<(), PropertyError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L379)

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

### complete_transition

```rust
fn complete_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L386)

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

### remove_transition

```rust
fn remove_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L389)

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

### set

```rust
fn set<T: 'static>(self: &mut Self, property: &str, value: T, now_ms: f64) -> Result<(), PropertyError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L392)

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

### get

```rust
fn get<T: Clone + 'static>(self: &mut Self, property: &str, now_ms: f64) -> Result<T, PropertyError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L401)

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

### sample

```rust
fn sample(self: &mut Self, now_ms: f64) -> Result<PaintSnapshot, PaintError>
```

Samples each registered property once and reuses an unchanged immutable
brush. Invalid paint parameters are reported before a renderer sees them.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L419)

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

### clone_snapshot

```rust
fn clone_snapshot(self: &mut Self, now_ms: f64) -> Result<Self, PaintError>
```

Creates an independent paint seeded from the current values. Registered
motion defaults/from/to all start at those values; animations, state
trackers and callbacks are intentionally instance-local.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L551)

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

### clear_cache

```rust
fn clear_cache(self: &mut Self)
```

Releases cached native brush handles; reference-counted render snapshots
remain valid for frames already retained by the host.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/paint/paint_motion.rs#L564)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Debug`
- `Default`

## Availability

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