diff --git a/README.md b/README.md index 4e98d2d..fc125d5 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,52 @@ HStack { +
+ Diamond + +`Diamond` shape and `.diamond` modifier is used to draw rhombuses or quadrangles: + +

+Diamond +

+ + +Use such way: + +

+Bubble +

+ +```swift +Text("Diamond") + .padding(.horizontal, 24) + .padding(.vertical, 16) + .background( + Diamond() + .stroke(.blue, lineWidth: 2) + ) +``` + +or via modifier: + +

+Bubble +

+ +```swift +Text("Diamond modifier") + .foregroundColor(.black) + .padding(24) + .diamond(top: .init(x: 40, y: 0), + bottom: .init(x: 0, y: 0), + withStroke: .black, + lineWidth: 2.0, + fill: .yellow) +``` + +
+ + ## Communication - If you like this repository, please do :star: to make this useful for others.