# BoxShadow

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

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

```rust
struct BoxShadow
```

Represents a box shadow which can be attached to an element or control.

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

## Members

- [`offset_x`](#struct_field-offset_x)
- [`offset_y`](#struct_field-offset_y)
- [`blur`](#struct_field-blur)
- [`spread`](#struct_field-spread)
- [`color`](#struct_field-color)
- [`is_inset`](#struct_field-is_inset)
- [`parse`](#function-parse)
- [`transform_bounds`](#function-transform_bounds)

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

### offset_x

```rust
offset_x: f64
```

The horizontal offset (distance) of the shadow.

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

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

### offset_y

```rust
offset_y: f64
```

The vertical offset (distance) of the shadow.

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

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

### blur

```rust
blur: f64
```

The blur radius. A higher value results in a more blurred shadow.

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

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

### spread

```rust
spread: f64
```

The spread radius. Positive values make the shadow grow, negative
values make it shrink.

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

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

### color

```rust
color: crate::media::Color
```

The color of the shadow.

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

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

### is_inset

```rust
is_inset: bool
```

Whether the shadow is an inner shadow (inset) rather than an outer
shadow (outset).

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

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

### parse

```rust
fn parse(s: &str) -> Result<BoxShadow, FormatError>
```

Parses a `BoxShadow` string: `[inset] offset-x offset-y [blur [spread]] color`,
or `none`.

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

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

### transform_bounds

```rust
fn transform_bounds(self: &Self, rect: Rect) -> Rect
```

Transforms the specified bounding rectangle to account for the shadow's
offset, spread, and blur.

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

## 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`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `FromStr`
- `Display`
- `BatchValue`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

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