From dfb44ba8de7cfecc796930cd63b81bbb39c3dee8 Mon Sep 17 00:00:00 2001 From: Alexander Kraev Date: Thu, 16 Feb 2023 22:16:54 +0300 Subject: [PATCH] Update README.md --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) 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.