Shape

public protocol Shape : Renderable, View
  • Declaration

    Swift

    var fillColor: Color { get set }
  • Declaration

    Swift

    var strokeBorderColor: Color { get set }
  • Declaration

    Swift

    var style: StrokeStyle { get set }
  • fill(_:) Extension method

    Fills this shape with a color.

    Declaration

    Swift

    public func fill(_ color: Color) -> Self

    Parameters

    color

    The color to use when filling this shape.

    Return Value

    A shape filled with the color you supply.

  • strokeBorder(_:lineWidth:) Extension method

    Returns a view that is the result of filling the width-sized border (aka inner stroke) of self with content. This is equivalent to insetting self by width / 2 and stroking the resulting shape with width as the line-width.

    Declaration

    Swift

    public func strokeBorder(_ color: Color, lineWidth: CGFloat = 1) -> Self
  • stroke(_:style:) Extension method

    Returns a view that is the result of insetting self by style.lineWidth / 2, stroking the resulting shape with style, and then filling with content.

    Declaration

    Swift

    public func stroke(_ color: Color, style: StrokeStyle) -> Self