import SwiftUI
public struct Pattern: View {
+
+ @Binding public var design: TileDesign;
+ public var pixelSize: CGFloat = 2.0;
+ public var foregroundColor: Color = .black
+ public var backgroundColor: Color = .white
private var patternSize: CGFloat {
pixelSize * 8.0;
}
- @Binding var design: TileDesign;
- var pixelSize: CGFloat = 2.0;
- var foregroundColor: Color = .black
- var backgroundColor: Color = .white
-
public var body: some View {
GeometryReader { gr in
VStack(spacing: 0) {
public struct PatternPicker: View {
- @Binding var selectedDesign: TileDesign;
+ @Binding public var selectedDesign: TileDesign;
- var selectedColor: Color = .accentColor
- var pixelSize: CGFloat = 2.0;
- var foregroundColor: Color = .black
- var backgroundColor: Color = .white
+ public var selectedColor: Color = .accentColor
+ public var pixelSize: CGFloat = 2.0;
+ public var foregroundColor: Color = .black
+ public var backgroundColor: Color = .white
let patterns = TileDesign.allCases
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()