plushie/prop/shadow

Shadow type for widget drop shadows.

Builder pattern: start with new() and pipe through color, offset, offset_x, offset_y, or blur_radius to configure.

Types

A drop shadow with color, offset, and blur.

pub type Shadow {
  Shadow(
    color: color.Color,
    offset_x: Float,
    offset_y: Float,
    blur_radius: Float,
  )
}

Constructors

  • Shadow(
      color: color.Color,
      offset_x: Float,
      offset_y: Float,
      blur_radius: Float,
    )

Values

pub fn blur_radius(s: Shadow, r: Float) -> Shadow

Set the blur radius.

pub fn color(s: Shadow, c: color.Color) -> Shadow

Set the shadow color.

pub fn new() -> Shadow

Create a shadow with default values (black, no offset, no blur).

pub fn offset(s: Shadow, x: Float, y: Float) -> Shadow

Set both offset components at once.

pub fn offset_x(s: Shadow, x: Float) -> Shadow

Set only the horizontal offset.

pub fn offset_y(s: Shadow, y: Float) -> Shadow

Set only the vertical offset.

pub fn to_prop_value(s: Shadow) -> node.PropValue

Encode a Shadow to its wire-format PropValue.

Offset is encoded as a two-element array [x, y] to match the Elixir SDK’s wire format.

Search Document