# `Toddy.Iced.Shadow`
[🔗](https://github.com/toddy-ui/toddy-elixir/blob/v0.3.0/lib/toddy/iced/shadow.ex#L1)

Shadow type for widget styling.

Used in `container` and other widgets via the `shadow` prop.
The renderer parses shadow into `iced::Shadow`.

## Wire format

    %{"color" => "#00000080", "offset" => [4, 4], "blur_radius" => 8.0}

The `offset` is an `[x, y]` list. `color` is a hex string (see `Toddy.Iced.Color`).

## Example

    shadow = Toddy.Iced.Shadow.new()
             |> Toddy.Iced.Shadow.color("#00000040")
             |> Toddy.Iced.Shadow.offset(2, 2)
             |> Toddy.Iced.Shadow.blur_radius(6)

# `t`

```elixir
@type t() :: %Toddy.Iced.Shadow{
  blur_radius: number(),
  color: Toddy.Iced.Color.t(),
  offset_x: number(),
  offset_y: number()
}
```

# `blur_radius`

```elixir
@spec blur_radius(shadow :: t(), r :: number()) :: t()
```

Sets the shadow blur radius in pixels.

# `color`

```elixir
@spec color(shadow :: t(), color :: Toddy.Iced.Color.input()) :: t()
```

Sets the shadow color. Accepts a hex string or named color atom.

# `new`

```elixir
@spec new() :: t()
```

Creates a new shadow with default values.

# `offset`

```elixir
@spec offset(shadow :: t(), x :: number(), y :: number()) :: t()
```

Sets the shadow offset in pixels.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
