ThemeShadow

public struct ThemeShadow : Equatable

Defines a shadow style for UI elements, including color, blur radius, and offset values. Used to indicate elevation, depth, or focus across your app.

  • The color of the shadow. Typically black with opacity in light mode or white with opacity in dark mode.

    Declaration

    Swift

    public let color: Color
  • The blur radius of the shadow. Larger values create softer, more diffused shadows.

    Declaration

    Swift

    public let radius: CGFloat
  • x

    The horizontal offset of the shadow. Positive values move the shadow to the right; negative to the left.

    Declaration

    Swift

    public let x: CGFloat
  • y

    The vertical offset of the shadow. Positive values move the shadow down; negative values move it up.

    Declaration

    Swift

    public let y: CGFloat
  • Initializes a new shadow definition.

    Declaration

    Swift

    public init(color: Color, radius: CGFloat, x: CGFloat, y: CGFloat)

    Parameters

    color

    The shadow color.

    radius

    The blur radius of the shadow.

    x

    Horizontal offset in points.

    y

    Vertical offset in points.

  • Returns a new ThemeShadow instance by copying the current one and applying the specified overrides.

    Declaration

    Swift

    func copy(
      color: Color? = nil,
      radius: CGFloat? = nil,
      x: CGFloat? = nil,
      y: CGFloat? = nil
    ) -> ThemeShadow

    Parameters

    color

    Optional override for the shadow color.

    radius

    Optional override for the blur radius.

    x

    Optional override for the horizontal offset.

    y

    Optional override for the vertical offset.

    Return Value

    A new ThemeShadow instance with the applied overrides.