# EffectParameterValue

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/effects/enum-effectparametervalue/

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

```rust
enum EffectParameterValue
```

The value of a parameter of a custom effect.

The parameters are what parsing reads and writes (`tint(color=#0F9D8E,
strength=0.55)`), what the default interpolation interpolates, and what a
backend factory hands to its GPU program as uniforms (an image as a
child).

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

## Members

- [`Bool`](#variant-bool)
- [`Int`](#variant-int)
- [`Float`](#variant-float)
- [`Color`](#variant-color)
- [`Point`](#variant-point)
- [`Vector`](#variant-vector)
- [`Size`](#variant-size)
- [`Rect`](#variant-rect)
- [`Text`](#variant-text)
- [`Image`](#variant-image)
- [`as_bool`](#function-as_bool)
- [`as_int`](#function-as_int)
- [`as_float`](#function-as_float)
- [`as_color`](#function-as_color)
- [`as_point`](#function-as_point)
- [`as_vector`](#function-as_vector)
- [`as_size`](#function-as_size)
- [`as_rect`](#function-as_rect)
- [`as_text`](#function-as_text)
- [`as_image`](#function-as_image)
- [`interpolate`](#function-interpolate)
- [`parse_like`](#function-parse_like)

<a id="variant-bool"></a>

### Bool

```rust
Bool(bool)
```

`true` or `false`. Steps when interpolated.

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

<a id="variant-int"></a>

### Int

```rust
Int(i32)
```

An integer, also the value of an enumeration. Interpolated and
rounded.

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

<a id="variant-float"></a>

### Float

```rust
Float(f64)
```

A number.

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

<a id="variant-color"></a>

### Color

```rust
Color(crate::media::Color)
```

A colour: `#AARRGGBB`, `#RRGGBB` or a colour name.

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

<a id="variant-point"></a>

### Point

```rust
Point(crate::Point)
```

A point: `x,y`.

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

<a id="variant-vector"></a>

### Vector

```rust
Vector(crate::Vector)
```

A vector: `x,y`.

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

<a id="variant-size"></a>

### Size

```rust
Size(crate::Size)
```

A size: `width,height`.

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

<a id="variant-rect"></a>

### Rect

```rust
Rect(crate::Rect)
```

A rectangle: `x,y,width,height`.

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

<a id="variant-text"></a>

### Text

```rust
Text(std::sync::Arc<str>)
```

A name or other text. Steps when interpolated.

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

<a id="variant-image"></a>

### Image

```rust
Image(super::EffectImage)
```

An image (#455, E6): a handle of a bitmap, compared by identity, that
the program of a shader effect samples as a child (see
`ShaderEffectDescription`). Switches at half when interpolated; an
empty handle takes the image of the other side.

An effect string cannot name an image (markup has no resource
context in an effect string): parsing a value for an image parameter
fails, and the effect string of a snapshot leaves its images out, so
that it parses back to the effect with empty images. An image is set
from code, on the value or on the snapshot of a mutable effect class.

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

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

### as_bool

```rust
fn as_bool(self: &Self) -> Option<bool>
```

The value as a boolean.

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

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

### as_int

```rust
fn as_int(self: &Self) -> Option<i32>
```

The value as an integer.

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

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

### as_float

```rust
fn as_float(self: &Self) -> Option<f64>
```

The value as a number; an integer converts.

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

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

### as_color

```rust
fn as_color(self: &Self) -> Option<Color>
```

The value as a colour.

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

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

### as_point

```rust
fn as_point(self: &Self) -> Option<Point>
```

The value as a point; a vector converts.

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

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

### as_vector

```rust
fn as_vector(self: &Self) -> Option<Vector>
```

The value as a vector; a point converts.

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

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

### as_size

```rust
fn as_size(self: &Self) -> Option<Size>
```

The value as a size.

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

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

### as_rect

```rust
fn as_rect(self: &Self) -> Option<Rect>
```

The value as a rectangle.

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

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

### as_text

```rust
fn as_text(self: &Self) -> Option<&str>
```

The value as text.

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

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

### as_image

```rust
fn as_image(self: &Self) -> Option<&EffectImage>
```

The value as an image.

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

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

### interpolate

```rust
fn interpolate(self: &Self, to: &Self, progress: f64) -> Option<Self>
```

The value at `progress` (0 to 1) of the way from `self` to `to`, or
`None` when the two are of different kinds or the kind does not
interpolate (booleans and text step). Two images switch at half; an
empty image is the other image all the way (a transition from no
effect keeps the images of the effect it goes to).

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

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

### parse_like

```rust
fn parse_like(self: &Self, text: &str) -> Option<Self>
```

Parses `text` as a value of the same kind as `self` (the kind of a
parameter is that of its current value), in the invariant format
`Display` writes. Composite values may be wrapped in
parentheses and separate their numbers with commas or spaces. An
image is never parsed: an effect string cannot name one.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`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`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Display`
- `From<bool>`
- `From<i32>`
- `From<f64>`
- `From<Color>`
- `From<Point>`
- `From<Vector>`
- `From<Size>`
- `From<Rect>`
- `From<&str>`
- `From<String>`
- `From<Arc<str>>`
- `From<EffectImage>`
- `From<&EffectImage>`

## Availability

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