]> git.r.bdr.sh - rbdr/patterns/blobdiff - Sources/Patterns/Tile.swift
Use design instead of pattern
[rbdr/patterns] / Sources / Patterns / Tile.swift
index 389332428f29b8ebe9e22f56ba7e10e4f77a7810..9c39640b8ab4dbfdae2ab29988ac9851a8310079 100644 (file)
@@ -2,15 +2,22 @@ import SwiftUI
 
 public struct Tile: View {
   
-  let design: TileDesign
-  var pixelSize: CGFloat = 2.0;
-  var foregroundColor: Color = .black
-  var backgroundColor: Color = .white
+  public let design: TileDesign
+  public var pixelSize: CGFloat = 2.0;
+  public var foregroundColor: Color = .black
+  public var backgroundColor: Color = .white
   
   private var pixels: [Int] {
     design.pixels()
   }
   
+  public init(design: TileDesign, pixelSize: CGFloat = 2.0, foregroundColor: Color = .black, backgroundColor: Color = .white) {
+    self.design = design
+    self.pixelSize = pixelSize
+    self.foregroundColor = foregroundColor
+    self.backgroundColor = backgroundColor
+  }
+  
     public var body: some View {
       VStack(spacing: 0) {
         ForEach(0 ..< 8) { i in