plushie/prop/border

Border type for widget outlines.

Builder pattern: start with new() and pipe through color, width, radius, or radius_corners to configure.

Types

A border with color, width, and corner radius.

pub type Border {
  Border(
    color: option.Option(color.Color),
    width: Float,
    radius: Radius,
  )
}

Constructors

pub type Radius {
  Uniform(Float)
  PerCorner(
    top_left: Float,
    top_right: Float,
    bottom_right: Float,
    bottom_left: Float,
  )
}

Constructors

  • Uniform(Float)
  • PerCorner(
      top_left: Float,
      top_right: Float,
      bottom_right: Float,
      bottom_left: Float,
    )

Values

pub fn color(b: Border, c: color.Color) -> Border

Set the border color.

pub fn new() -> Border

Create a border with default values (no color, zero width, zero radius).

pub fn radius(b: Border, r: Float) -> Border

Set a uniform border radius.

pub fn radius_corners(
  b: Border,
  tl: Float,
  tr: Float,
  br: Float,
  bl: Float,
) -> Border

Set per-corner border radii.

pub fn to_prop_value(b: Border) -> node.PropValue

Encode a Border to its wire-format PropValue.

pub fn width(b: Border, w: Float) -> Border

Set the border width.

Search Document