Skip to content

A SwiftUI convenience wrapper to allow you to set both a foreground color and stroke for a shape.

Notifications You must be signed in to change notification settings

reuschj/StrokedShape

Repository files navigation

StrokedShape

SwiftUI allows a Shape to have either a foreground color added or a stroke, but not both. The solution is easy, but somewhat cumbersome: give the shape a foreground color, then overlay an identical shape with a stroke.

This is a package to reduce this boilerplate of giving a shape both a foreground color and stroke.

StrokedShape(
    foreground: .blue,
    outlineColor: .black,
    outlineWidth: 1
) {
    Circle()
}

About

A SwiftUI convenience wrapper to allow you to set both a foreground color and stroke for a shape.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages