Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
import SwiftUI
struct ContentView: View {
var body: some View {
Canvas { context, size in
for _ in 0..<100 {
let rect = CGRect(x: .random(in: 0...size.width), y: .random(in: 0...size.height), width: .random(in: 20...100), height: .random(in: 20...100))
context.fill(Path(rect), with: .color(Color(hue: .random(in: 0...1), saturation: 1, brightness: 1)))
}
}
}
}Coding works best on desktop or with an external keyboard.